IndicatorStyle QML Type
コントロールのインジケータのスタイルを定義します。詳細...
| Import Statement: | import Qt.labs.StyleKit |
| Inherits: |
プロパティ
- down : SubIndicatorStyle
- foreground : DelegateStyle
- up : SubIndicatorStyle
詳細説明
IndicatorStyleは、インジケーターのスタイリングに特化したプロパティでDelegateStyle を拡張します。
IndicatorStyle 自体はインジケータの背景を記述し、foreground はその中に描画されるコンテンツを記述します。例えば、checkBox.indicator はチェック・ボックスのフレームをスタイルし、checkBox.indicator.foreground はチェック・マークをスタイルします。switchControl 、slider 、progressBar では、インジケータが溝をスタイルし、前景が塗りつぶしをスタイルします。
checkBox { background.visible: false text.alignment: Qt.AlignVCenter | Qt.AlignLeft indicator { color: "transparent" border.width: 1 foreground { color: "transparent" image.source: "qrc:/qt-project.org/imports/QtQuick/Controls/Basic/images/check.png" // Hide the checkMark when the CheckBox is unchecked visible: false } } checked { // Show the checkMark when the CheckBox is checked indicator.foreground.visible: true } }
コントロールによっては複数のインジケータを持つものもある。例えば、SpinBox には増分ボタンと減分ボタンがある。これらは、up とdown のサブ・インジケータ、spinBox.indicator.up とspinBox.indicator.down を使って、独立してスタイルを設定することができます。サブ・インジケータに設定されていないプロパティは、インジケータ自体にフォールバックされます。
spinBox { text.alignment: Qt.AlignHCenter | Qt.AlignVCenter padding: 0 indicator { implicitHeight: Style.Stretch color: "navy" opacity: 0.1 foreground { color: "transparent" margins: 10 image.color: "navy" image.fillMode: Image.PreserveAspectFit image.source: "qrc:/qt-project.org/imports/QtQuick/Controls/Basic/images/arrow-indicator.png" implicitWidth: 10 implicitHeight: 10 alignment: Qt.AlignCenter } down { alignment: Qt.AlignLeft foreground.rotation: 90 } up { alignment: Qt.AlignRight foreground.rotation: -90 } } }
注意: Qt.labsモジュールの型は、将来のバージョンでも互換性が保たれることを保証するものではありません。
SubIndicatorStyle,DelegateStyle,ControlStyle,ControlStateStyle,FallbackStyle Referenceも参照してください 。
プロパティのドキュメント
down : SubIndicatorStyle
ダウン(デクリメント)サブインジケータをスタイリングするためのグループ化されたプロパティ。これはSpinBox などのコントロールで使用されます。設定されていないプロパティは、インジケータ自体にフォールバックされます。
upも参照してください 。
foreground : DelegateStyle
このインジケータの前景要素をスタイリングするためのグループ化されたプロパティ。例えば、checkBox.indicator はチェックボックスの枠を表し、checkBox.indicator.foreground はチェックマークです。
slider 、progressBar 、switchControl のようなコントロールの場合、indicator.foreground は溝内の進捗トラックまたは塗りつぶしを表し、indicator 自体は溝を表します。
up : SubIndicatorStyle
up(インクリメント)サブインジケータをスタイリングするためのグループ化されたプロパティ。これはSpinBox などのコントロールで使用されます。設定されていないプロパティは、インジケータ自体にフォールバックされます。
downも参照してください 。
© 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.