Palette QML Type
各 QML アイテムの状態に対応する色グループを含む。詳細...
Import Statement: | import QtQuick |
Inherits: |
プロパティ
詳細説明
パレットは3つのカラーグループで構成されます:active
disabled
およびinactive
。active
これらのグループの色が明示的に指定されていない場合は、その色が他のグループに使用されます。
以下の例では、すべてのカラーグループに色が適用されます:
ApplicationWindow { palette.buttonText: "salmon" ColumnLayout { Button { text: qsTr("Disabled button") enabled: false } Button { text: qsTr("Enabled button") } } }
こ れは、 テ キ ス ト 色が ど ち ら のボ タ ン で も同 じ にな る こ と を意味 し ます。
次の例では、enabledとdisabledで色が異なります:
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 スタイルが使用されている場合は、その可能性もあります。
注意: Controlsスタイルの中には、いくつかのパレットカラーを使用するものもありますが、多くのスタイルは独立したカラーを使用します。
Window::palette 、Item::palette 、Popup::palette 、SystemPaletteも参照してください 。
プロパティ文書
active : ColorGroup |
Activeグループは、フォーカスが当たっているウィンドウに使われます。
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.