DelegateChoice QML Type

封装委托以及何时使用委托。更多

Import Statement: import QtQml.Models
Since: Qt 6.9

属性

详细说明

DelegateChoice 类型封装了一个委托,并定义了在何种情况下应选择该委托。

DelegateChoices 可以嵌套在DelegateChooser 中。

另请参阅 DelegateChooser

属性文档

column : int

该属性保存用于匹配模型元素列值的值。


delegate : Component

该属性用于保存与模型项匹配的委托值。


index : int

该属性包含用于匹配模型元素索引值的值。这实际上是row 的别名。

另请参阅 row


roleValue : variant

该属性持有用于匹配DelegateChooser::role 提供的角色数据的值。


row : int

该属性的值用于匹配模型元素的行值。对于只有索引属性(因此只有一列)的模型,此属性应作为索引,并设置为所需的索引值。

注意: 同时设置行和索引会产生未定义的行为。这两个属性是等价的,只能使用其中一个。

另请参见 index


© 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.