委托控件
Qt Quick Controls 提供了一系列可在视图中用作委托控件的控件。
带复选标记的项目委托控件,该标记可切换为开启或关闭状态 | |
可在各种视图和控件中使用的基本项目委托控件 | |
带单选指示器的排他性项目委托控件,该指示器可切换为开启或关闭状态 | |
可滑动项目委托控件 | |
带开关指示器的项目委托,该指示器可开启或关闭 | |
可分配给 TableView 的委托 | |
可分配给 TreeView 的委托 | |
每种类型的委托都有其特定的目标用例。以下各节将根据具体用例,提供选择合适委托类型的指导原则。
CheckDelegate 控件
CheckDelegate 提供了一个可选中控件,可将其切换为选中(启用)或未选中(禁用)状态。复选框委托通常用于从一组选项中选择一个或多个选项。
另请参阅 “复选框控件”。
ItemDelegate 控件
ItemDelegate 提供了一个可选中控件,用户可以按下或单击该控件。
单选按钮控件
RadioDelegate 提供了一个可选中控件,可切换为“选中”或“未选中”状态。单选控件通常用于从一组选项中选择一个选项。
另请参阅 RadioButton 控件。
SwipeDelegate 控件
SwipeDelegate 提供了一个视图项,用户可以向左或向右滑动以显示更多选项或信息。
SwitchDelegate 控件
SwitchDelegate 提供了一个可切换的委托,可将其开启或关闭。
另请参阅 Switch 控件。
TableViewDelegate 控件

TableViewDelegate 是一种委托,可分配给TableView 的delegate 属性。
另请参阅 TableView
TreeViewDelegate 控件

TreeViewDelegate 是一种可分配给TreeView 的 delegate 属性的委托。
另请参阅 TreeView 。
相关信息
© 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.