QDeclarativeListProperty Class ReferenceThe QDeclarativeListProperty class allows applications to expose list-like properties to QML. More... #include <QDeclarativeListProperty> This class was introduced in Qt 4.7. Public Types
Public Functions
Detailed DescriptionThe QDeclarativeListProperty 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 QDeclarativeListProperty 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 QDeclarativeListProperty 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(QDeclarativeListProperty<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. Note: QDeclarativeListProperty can only be used for lists of QObject-derived object pointers. See also Object and List Property Types. Member Type Documentation
|