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.