ItemDelegate QML Type
様々なビューやコントロールで使用できる基本的なアイテムデリゲート。詳細...
Import Statement: | import QtQuick.Controls |
Inherits: | |
Inherited By: | CheckDelegate, RadioDelegate, SwipeDelegate, SwitchDelegate, and TreeViewDelegate |
プロパティ
- highlighted : bool
詳細説明
ItemDelegateは標準的なビューアイテムを提示する。これは、ListView やComboBox のような様々なビューやコントロールでデリゲートとして使用することができます。
ItemDelegate は、その API をAbstractButton から継承しています。例えば、AbstractButton API を使って、text を設定したり、アイコンを表示したり、clicks に反応したりすることができます。
ListView { id: listView width: 160 height: 240 model: Qt.fontFamilies() delegate: ItemDelegate { text: modelData width: listView.width onClicked: console.log("clicked:", modelData) required property string modelData } ScrollIndicator.vertical: ScrollIndicator { } }
ItemDelegateと Delegateコントロールのカスタマイズも参照してください 。
プロパティ ドキュメント
highlighted : bool |
このプロパティは、デリゲートがハイライトされているかどうかを保持します。
デリゲートをハイライトすることで、ユーザーの注意をそちらに向けることができます。これは、キーボード操作には影響しません。例えば、次のコードを使用して、ListView の現在の項目を強調表示することができます:
ListView { id: listView model: 10 delegate: ItemDelegate { text: index highlighted: ListView.isCurrentItem required property int index onClicked: listView.currentIndex = index } }
デフォルト値はfalse
です。
© 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.