Palette QML Type

각 QML 항목 상태에 대한 색상 그룹을 포함합니다. 더 보기...

Import Statement: import QtQuick
Inherits:

ColorGroup

속성

자세한 설명

팔레트는 세 가지 색상 그룹으로 구성됩니다: active, disabled, inactive 의 세 가지 색상 그룹으로 구성됩니다. active 색상 그룹은 기본 그룹으로, 이 그룹의 색상이 명시적으로 지정되지 않은 경우 다른 그룹에 해당 색상이 사용됩니다.

다음 예에서는 모든 색상 그룹에 색상이 적용됩니다:

ApplicationWindow {
    palette.buttonText: "salmon"

    ColumnLayout {
        Button {
            text: qsTr("Disabled button")
            enabled: false
        }

        Button {
            text: qsTr("Enabled button")
        }
    }
}

즉, 두 버튼의 텍스트 색상이 동일합니다.

다음 예에서는 활성화 상태와 비활성화 상태에 따라 색상이 달라집니다:

ApplicationWindow {
    palette.buttonText: "salmon"
    palette.disabled.buttonText: "lavender"

    ColumnLayout {
        Button {
            text: qsTr("Disabled button")
            enabled: false
        }

        Button {
            text: qsTr("Enabled button")
        }
    }
}

이와 같이 색상을 지정할 수도 있습니다:

palette {
    buttonText: "red"
    button: "khaki"

    disabled {
        buttonText: "lavender"
        button: "coral"
    }
}

이 방법은 모든 색상 그룹으로 전체 팔레트를 지정해야 할 때 특히 편리하지만, 위의 다른 경우와 마찬가지로 지정하지 않은 색상은 SystemPalette 또는 사용 중인 경우 Qt Quick Controls 스타일에서 초기화됩니다.

참고: 일부 컨트롤 스타일은 일부 팔레트 색상을 사용하지만 많은 스타일은 독립적인 색상을 사용합니다.

Window::palette, Item::palette, Popup::palette, SystemPalette참조하세요 .

속성 문서

active : ColorGroup

활성 그룹은 초점이 맞춰진 창에 사용됩니다.

QPalette::Active도 참조하십시오 .


disabled : ColorGroup

Disabled 그룹은 어떤 이유로 비활성화된 요소에 사용됩니다.

QPalette::Disabled도 참조하십시오 .


inactive : ColorGroup

비활성 그룹은 키보드 포커스가 없는 창에 사용됩니다.

QPalette::Inactive도 참조하십시오 .


© 2025 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.