이 페이지에서

StyleKitDebug QML Type

컨트롤에 대해 스타일 속성이 어떻게 적용되는지 추적합니다. 더 보기...

Import Statement: import Qt.labs.StyleKit
Status: Technology preview

이 유형은 기술 미리 보기 단계에 있으며 변경될 수 있습니다.

속성

상세 설명

StyleKitDebug는 스타일 속성 읽기 작업을 디버그 출력에 기록하는 앱 내 진단 도구입니다. 특히 여러 themes 또는 style variations 가 포함된 복잡한 스타일에서 컨트롤이 특정 모양으로 표시되는 원인을 파악하는 데 유용합니다.

StyleKit.debug 를 통해 이 도구에 접근할 수 있습니다.

참고: 이 도구는 실험적입니다. 이 기능을 활성화하면 성능이 크게 저하되므로 디버깅 용도로만 사용해야 합니다. 출력 형식은 향후 버전에서 변경될 수 있습니다.

추적을 시작하려면, 내부 상태를 분석하려는 컨트롤을 control 속성에 할당하십시오:

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"
        }
    }
}

해결된 각 속성은 값의 출처와 최종 해결 결과를 보여주는 한 줄로 출력됩니다:

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

출력에 나타나는 ‘ StyleReader ’은 ‘ Button ’가 내부적으로 스타일 속성 값을 읽기 위해 사용하는 ‘ StyleReader ’을 가리킵니다.

StyleReader 의 속성 읽기 과정을 추적하면 방대한 양의 출력이 생성될 수 있습니다. filter 를 사용하여 관심 있는 속성으로만 출력을 제한하십시오.

참고: Qt.labs 모듈의 타입은 향후 버전에서 호환성이 보장되지 않습니다.

StyleKit::debug 및 StyleKit 속성 해결항목도 참조하십시오 .

속성 문서

control : Item

추적할 ` Control ` 또는 ` StyleReader `의 ID입니다.

이 속성이 설정되면 StyleKit은 이 항목에 대한 모든 스타일 속성 읽기 작업을 디버그 출력에 기록합니다. 추적을 중지하려면 null 로 설정하십시오.

filter도 참조하십시오 .

filter : string

디버그 출력을 필터링하는 데 사용되는 정규 표현식입니다. 패턴과 일치하는 줄만 출력됩니다. 기본적으로 모든 출력이 표시됩니다.

예를 들어, 배경색만 추적하려면:

StyleKit.debug.filter: "background.color"

background.color, background.border.color, background.image.color, background.shadow.color 와 같은 속성을 포함한 모든 배경색을 추적하려면 다음 정규 표현식을 사용하십시오:

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

control도 참조하십시오 .

© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.