DelegateChooser QML Type

Allows a view to use different delegates for different types of items in the model. More...

Import Statement: import Qt.labs.qmlmodels 1.0

Properties

Detailed Description

The DelegateChooser is a special Component type intended for those scenarios where a Component is required by a view and used as a delegate. DelegateChooser encapsulates a set of DelegateChoices. These choices are used determine the delegate that will be instantiated for each item in the model. The selection of the choice is performed based on the value that a model item has for role, and also based on index.

Note: This type is intended to transparently work only with TableView and any DelegateModel-based view. Views (including user-defined views) that aren't internally based on a DelegateModel need to explicitly support this type of component to make it function as described.

See also DelegateChoice.

Property Documentation

[default] choices : list<DelegateChoice>

The list of DelegateChoices for the chooser.

The list is treated as an ordered list, where the first DelegateChoice to match will be used be a view.

It should not generally be necessary to refer to the choices property, as it is the default property for DelegateChooser and thus all child items are automatically assigned to this property.


role : string

This property holds the role used to determine the delegate for a given model item.

See also DelegateChoice.


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