- Qt 6.11
- Qt Labs StyleKit
- QML Types
- StyleKitDebug
- Qt 6.11.2 Reference Documentation

# StyleKitDebug QML Type

Traces how style properties are resolved for a control. More...

Import Statement: | `import Qt.labs.StyleKit`

- List of all members, including inherited members

## Properties

- control : Item
- filter : string

## Detailed Description

StyleKitDebug is a diagnostic in-app tool that logs style property reads to the debug output. It is useful for understanding why a control ends up with a particular appearance, especially in complex styles that involve multiple themes or style variations.

It is accessed through StyleKit.debug.

Note: This tool is experimental. Enabling it will severely degrade performance and should only be used for debugging. The output format may change in future versions.

To start tracing, assign the control you want to introspect to the control property:

     ApplicationWindow {
         id: app
         width: 1024
         height: 800
         visible: true

         StyleKit.debug.control: someButton
         StyleKit.debug.filter: "background.color"

         StyleKit.style: Style {
             button {
                 background.color: "gray"
                 hovered.background.color: "dimgray"
             }
             dark: Theme {
                 button {
                     background.color: "skyblue"
                     hovered.background.color: "lightblue"
                 }
             }
         }

         Column {
             anchors.fill: parent
             anchors.margins: 10
             spacing: 10

             Button {
                 id: someButton
                 text: "A Button"
             }
         }
     }

Each resolved property is printed as a single line showing where the value came from and what it resolved to:

     [read] StyleReader[Hovered].button.background.color -> Style.Theme(Dark).button[Hovered] = #add8e6

The `StyleReader` in the output refers to the StyleReader that the Button uses internally to read its style property values.

Tracing the property reads of a StyleReader can produce a large amount of output. Use filter to limit the output to properties of interest.

Note: Types in Qt.labs modules are not guaranteed to remain compatible in future versions.

See also StyleKit::debug and StyleKit Property Resolution.

## Property Documentation

### control : Item

The id of the Control or StyleReader to trace.

When set, StyleKit logs all style property reads for this item to the debug output. Set to `null` to stop tracing.

See also filter.

### filter : string

A regular expression used to filter the debug output. Only lines matching the pattern are printed. By default, all output is shown.

For example, to only trace the background color:

     StyleKit.debug.filter: "background.color"

To trace all background colors, including properties such as background.color, background.border.color, background.image.color, and background.shadow.color, use a regular expression:

     StyleKit.debug.filter: "background.*color"

See also control.