QQmlListProperty ClassThe QQmlListProperty class allows applications to expose list-like properties to QML. More... #include <QQmlListProperty> This class was introduced in Qt 5.0. Public Types
Public Functions
Detailed DescriptionThe QQmlListProperty class allows applications to expose list-like properties to QML. QML has many list properties, where more than one object value can be assigned. The use of a list property from QML looks like this: FruitBasket { fruit: [ Apple {}, Orange{}, Banana{} ] } The QQmlListProperty encapsulates a group of function pointers that represet the set of actions QML can perform on the list - adding items, retrieving items and clearing the list. In the future, additional operations may be supported. All list properties must implement the append operation, but the rest are optional. To provide a list property, a C++ class must implement the operation callbacks, and then return an appropriate QQmlListProperty value from the property getter. List properties should have no setter. In the example above, the Q_PROPERTY() declarative will look like this: Q_PROPERTY(QQmlListProperty<Fruit> fruit READ fruit); QML list properties are typesafe - in this case Fruit is a QObject type that Apple, Orange and Banana all derive from. The QtQuick 1 version of this class is named QDeclarativeListProperty. Note: QQmlListProperty can only be used for lists of QObject-derived object pointers. See also Object and List Property Types. Member Type Documentation
|