VoltAir
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Groups Pages
Static Public Member Functions | List of all members
Util::QQmlListPropertyOnQList< TObject, TData, TListType, TObjectField, TChangeFunc > Class Template Reference

Helper class which creates QQmlListProperty objects directly on QList members fields. More...

Static Public Member Functions

static QQmlListProperty< TData > createList (TObject *owner)
 Create and return a QQmlListProperty<TData>. More...
 

Detailed Description

template<typename TObject, typename TData, typename TListType, TListType TObject::* TObjectField, void(TObject::*)() TChangeFunc = nullptr>
class Util::QQmlListPropertyOnQList< TObject, TData, TListType, TObjectField, TChangeFunc >

Helper class which creates QQmlListProperty objects directly on QList members fields.

The location of the member field is declared as a template parameter. The location of the change signal is passed as the QQmlListProperty's user data. It may be null.

Note
QQmlListProperty has a constructor which takes a reference to a QList, but we cannot use it. According to the Qt documentation: "Convenience constructor for making a QQmlListProperty value from an existing QList list. The list reference must remain valid for as long as object exists. object must be provided. Generally this constructor should not be used in production code, as a writable QList violates QML's memory management rules. However, this constructor can very useful while prototyping."

Member Function Documentation

template<typename TObject , typename TData , typename TListType , TListType TObject::* TObjectField, void(TObject::*)() TChangeFunc = nullptr>
static QQmlListProperty<TData> Util::QQmlListPropertyOnQList< TObject, TData, TListType, TObjectField, TChangeFunc >::createList ( TObject *  owner)
inlinestatic

Create and return a QQmlListProperty<TData>.