ItemDelegate QML Type
基本项目委托,可用于各种视图和控件。更多
Import Statement: | import QtQuick.Controls |
Inherits: | |
Inherited By: | CheckDelegate, RadioDelegate, SwipeDelegate, SwitchDelegate, TableViewDelegate, and TreeViewDelegate |
属性
- highlighted : bool
详细说明
ItemDelegate 展示了一个标准视图项目。它可在各种视图和控件(如ListView 和ComboBox )中用作委托。
ItemDelegate 从AbstractButton 继承其 API。例如,您可以使用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和委托控件。
属性文档
highlighted : bool |
© 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.