Qt 4.8
|
The QDeclarativeListProperty class allows applications to expose list-like properties to QML. More...
#include <qdeclarativelist.h>
Public Types | |
typedef void(* | AppendFunction) (QDeclarativeListProperty< T > *, T *) |
Synonym for {void (*)(QDeclarativeListProperty<T> *property, T *value)}. More... | |
typedef void(* | AppendFunction) (QDeclarativeListProperty< T > *, T *) |
typedef T *(* | AtFunction) (QDeclarativeListProperty< T > *, int) |
Synonym for {T *(*)(QDeclarativeListProperty<T> *property, int index)}. More... | |
typedef T *(* | AtFunction) (QDeclarativeListProperty< T > *, int) |
typedef void(* | ClearFunction) (QDeclarativeListProperty< T > *) |
Synonym for {void (*)(QDeclarativeListProperty<T> *property)}. More... | |
typedef void(* | ClearFunction) (QDeclarativeListProperty< T > *) |
typedef int(* | CountFunction) (QDeclarativeListProperty< T > *) |
Synonym for {int (*)(QDeclarativeListProperty<T> *property)}. More... | |
typedef int(* | CountFunction) (QDeclarativeListProperty< T > *) |
Public Functions | |
bool | operator== (const QDeclarativeListProperty &o) const |
Returns true if this QDeclarativeListProperty is equal to other, otherwise false. More... | |
bool | operator== (const QDeclarativeListProperty &o) const |
QDeclarativeListProperty () | |
QDeclarativeListProperty (QObject *o, QList< T *> &list) | |
Convenience constructor for making a QDeclarativeListProperty value from an existing QList list. More... | |
QDeclarativeListProperty (QObject *o, void *d, AppendFunction a, CountFunction c=0, AtFunction t=0, ClearFunction r=0) | |
Construct a QDeclarativeListProperty from a set of operation functions. More... | |
QDeclarativeListProperty () | |
QDeclarativeListProperty (QObject *o, QList< T *> &list) | |
QDeclarativeListProperty (QObject *o, void *d, AppendFunction a, CountFunction c=0, AtFunction t=0, ClearFunction r=0) | |
Public Variables | |
AppendFunction | append |
AtFunction | at |
ClearFunction | clear |
CountFunction | count |
void * | data |
void * | dummy1 |
void * | dummy2 |
QObject * | object |
Static Private Functions | |
static void | qlist_append (QDeclarativeListProperty *p, T *v) |
static void | qlist_append (QDeclarativeListProperty *p, T *v) |
static T * | qlist_at (QDeclarativeListProperty *p, int idx) |
static T * | qlist_at (QDeclarativeListProperty *p, int idx) |
static void | qlist_clear (QDeclarativeListProperty *p) |
static void | qlist_clear (QDeclarativeListProperty *p) |
static int | qlist_count (QDeclarativeListProperty *p) |
static int | qlist_count (QDeclarativeListProperty *p) |
The 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:
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 ) declarative will;;
QML list properties are typesafe - in this case {Fruit}
is a QObject type that {Apple}
, {Orange}
and {Banana}
all derive from.
Definition at line 61 of file qdeclarativelist.h.
QDeclarativeListProperty< T >::AppendFunction |
Synonym for {void
(*)(QDeclarativeListProperty<T> *property, T *value)}.
Append the value to the list property.
Definition at line 63 of file qdeclarativelist.h.
typedef void(* QDeclarativeListProperty< T >::AppendFunction) (QDeclarativeListProperty< T > *, T *) |
Definition at line 79 of file qgraphicsitem_p.h.
QDeclarativeListProperty< T >::AtFunction |
Synonym for {T
*(*)(QDeclarativeListProperty<T> *property, int index)}.
Return the element at position index in the list property.
Definition at line 65 of file qdeclarativelist.h.
typedef T*(* QDeclarativeListProperty< T >::AtFunction) (QDeclarativeListProperty< T > *, int) |
Definition at line 81 of file qgraphicsitem_p.h.
QDeclarativeListProperty< T >::ClearFunction |
Synonym for {void
(*)(QDeclarativeListProperty<T> *property)}.
Clear the list property.
Definition at line 66 of file qdeclarativelist.h.
typedef void(* QDeclarativeListProperty< T >::ClearFunction) (QDeclarativeListProperty< T > *) |
Definition at line 82 of file qgraphicsitem_p.h.
QDeclarativeListProperty< T >::CountFunction |
Synonym for {int
(*)(QDeclarativeListProperty<T> *property)}.
Return the number of elements in the list property.
Definition at line 64 of file qdeclarativelist.h.
typedef int(* QDeclarativeListProperty< T >::CountFunction) (QDeclarativeListProperty< T > *) |
Definition at line 80 of file qgraphicsitem_p.h.
|
inline |
Definition at line 68 of file qdeclarativelist.h.
|
inline |
Convenience constructor for making a QDeclarativeListProperty 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.
Definition at line 70 of file qdeclarativelist.h.
|
inline |
Construct a QDeclarativeListProperty from a set of operation functions.
An opaque data handle may be passed which can be accessed from within the operation functions. The list property remains valid while object exists.
The append operation is compulsory and must be provided, while the count, at and clear methods are optional.
Definition at line 73 of file qdeclarativelist.h.
|
inline |
Definition at line 84 of file qgraphicsitem_p.h.
|
inline |
Definition at line 86 of file qgraphicsitem_p.h.
|
inline |
Definition at line 89 of file qgraphicsitem_p.h.
|
inline |
Returns true if this QDeclarativeListProperty is equal to other, otherwise false.
Definition at line 77 of file qdeclarativelist.h.
|
inline |
Definition at line 93 of file qgraphicsitem_p.h.
|
inlinestaticprivate |
Definition at line 100 of file qdeclarativelist.h.
|
inlinestaticprivate |
Definition at line 116 of file qgraphicsitem_p.h.
|
inlinestaticprivate |
Definition at line 106 of file qdeclarativelist.h.
|
inlinestaticprivate |
Definition at line 122 of file qgraphicsitem_p.h.
|
inlinestaticprivate |
Definition at line 109 of file qdeclarativelist.h.
|
inlinestaticprivate |
Definition at line 125 of file qgraphicsitem_p.h.
|
inlinestaticprivate |
Definition at line 103 of file qdeclarativelist.h.
|
inlinestaticprivate |
Definition at line 119 of file qgraphicsitem_p.h.
AppendFunction QDeclarativeListProperty< T >::append |
Definition at line 89 of file qdeclarativelist.h.
Referenced by QDeclarativeListReference::append(), QDeclarativeTransitionPrivate::append_animation(), QDeclarativeXmlListModelPrivate::append_role(), QDeclarativeStateGroupPrivate::append_state(), QDeclarativeStateGroupPrivate::append_transition(), QDeclarativeListReference::canAppend(), QDeclarativeListProperty< QDeclarativeXmlListModelRole >::operator==(), QDeclarativeListProperty< QDeclarativeXmlListModelRole >::qlist_append(), QDeclarativeXmlListModel::roleObjects(), QDeclarativePropertyAction::transition(), QDeclarativePropertyAnimation::transition(), and QDeclarativeAnimationGroup::~QDeclarativeAnimationGroup().
AtFunction QDeclarativeListProperty< T >::at |
Definition at line 92 of file qdeclarativelist.h.
Referenced by QDeclarativeTransitionPrivate::animation_at(), QDeclarativeListReference::at(), QDeclarativeStateGroupPrivate::at_state(), QDeclarativeStateGroupPrivate::at_transition(), QDeclarativeListReference::canAt(), QDeclarativeAnimationGroupPrivate::clear_animation(), QDeclarativeTransitionPrivate::clear_animations(), QDeclarativeStateGroupPrivate::clear_states(), QDeclarativeStateGroupPrivate::findTransition(), QDeclarativeListProperty< QDeclarativeXmlListModelRole >::operator==(), QDeclarativeListScriptClass::property(), QDeclarativeListProperty< QDeclarativeXmlListModelRole >::qlist_at(), QDeclarativePropertyAction::transition(), and QDeclarativePropertyAnimation::transition().
ClearFunction QDeclarativeListProperty< T >::clear |
Definition at line 94 of file qdeclarativelist.h.
Referenced by QDeclarativeListReference::canClear(), QDeclarativeListReference::clear(), QDeclarativeXmlListModelPrivate::clear_role(), QDeclarativeStateGroupPrivate::clear_states(), QDeclarativeStateGroupPrivate::clear_transitions(), QDeclarativeListProperty< QDeclarativeXmlListModelRole >::operator==(), QDeclarativeListProperty< QDeclarativeXmlListModelRole >::qlist_clear(), QDeclarativeXmlListModel::roleObjects(), and QDeclarativeAnimationGroup::~QDeclarativeAnimationGroup().
CountFunction QDeclarativeListProperty< T >::count |
Definition at line 91 of file qdeclarativelist.h.
Referenced by QDeclarativeTransitionPrivate::animation_count(), QDeclarativeXmlListModelPrivate::append_role(), QDeclarativeListReference::canCount(), QDeclarativeAnimationGroupPrivate::clear_animation(), QDeclarativeTransitionPrivate::clear_animations(), QDeclarativeStateGroupPrivate::clear_states(), QDeclarativeListReference::count(), QDeclarativeStateGroupPrivate::count_state(), QDeclarativeStateGroupPrivate::count_transitions(), QDeclarativeStateGroupPrivate::findTransition(), QDeclarativeListProperty< QDeclarativeXmlListModelRole >::operator==(), QDeclarativeListScriptClass::property(), QDeclarativeListProperty< QDeclarativeXmlListModelRole >::qlist_count(), QDeclarativePropertyAction::transition(), and QDeclarativePropertyAnimation::transition().
void * QDeclarativeListProperty< T >::data |
Definition at line 87 of file qdeclarativelist.h.
Referenced by QDeclarativeVisualItemModelPrivate::children_append(), QDeclarativeVisualItemModelPrivate::children_at(), QDeclarativeVisualItemModelPrivate::children_count(), QDeclarativeContextPrivate::context_at(), QDeclarativeContextPrivate::context_count(), QDeclarativePackagePrivate::data_append(), QDeclarativeFlickablePrivate::data_append(), QDeclarativePackagePrivate::data_at(), QDeclarativePackagePrivate::data_clear(), QDeclarativePackagePrivate::data_count(), QDeclarativeVMEMetaObject::list_append(), QDeclarativeVMEMetaObject::list_at(), QDeclarativeVMEMetaObject::list_clear(), QDeclarativeVMEMetaObject::list_count(), QDeclarativeStatePrivate::operations_append(), QDeclarativeStatePrivate::operations_at(), QDeclarativeStatePrivate::operations_clear(), QDeclarativeStatePrivate::operations_count(), QDeclarativeListProperty< QDeclarativeXmlListModelRole >::operator==(), QDeclarativeListProperty< QDeclarativeXmlListModelRole >::qlist_append(), QDeclarativeListProperty< QDeclarativeXmlListModelRole >::qlist_at(), QDeclarativeListProperty< QDeclarativeXmlListModelRole >::qlist_clear(), and QDeclarativeListProperty< QDeclarativeXmlListModelRole >::qlist_count().
void * QDeclarativeListProperty< T >::dummy1 |
Definition at line 96 of file qdeclarativelist.h.
Referenced by QDeclarativeListProperty< QDeclarativeXmlListModelRole >::operator==().
void * QDeclarativeListProperty< T >::dummy2 |
Definition at line 97 of file qdeclarativelist.h.
Referenced by QDeclarativeListProperty< QDeclarativeXmlListModelRole >::operator==().
QObject * QDeclarativeListProperty< T >::object |
Definition at line 86 of file qdeclarativelist.h.
Referenced by QDeclarativeTransitionPrivate::animation_at(), QDeclarativeTransitionPrivate::animation_count(), QDeclarativeTransitionPrivate::append_animation(), QDeclarativeAnimationGroupPrivate::append_animation(), QDeclarativeXmlListModelPrivate::append_role(), QDeclarativeStateGroupPrivate::append_state(), QDeclarativeStateGroupPrivate::append_transition(), QDeclarativeStateGroupPrivate::at_state(), QDeclarativeStateGroupPrivate::at_transition(), QDeclarativeVisualItemModelPrivate::children_append(), QGraphicsItemPrivate::children_append(), QGraphicsItemPrivate::children_at(), children_at_helper(), QGraphicsItemPrivate::children_clear(), children_clear_helper(), QGraphicsItemPrivate::children_count(), children_count_helper(), QDeclarativeAnimationGroupPrivate::clear_animation(), QDeclarativeTransitionPrivate::clear_animations(), QDeclarativeXmlListModelPrivate::clear_role(), QDeclarativeStateGroupPrivate::clear_states(), QDeclarativeStateGroupPrivate::clear_transitions(), QDeclarativeContextPrivate::context_at(), QDeclarativeContextPrivate::context_count(), QDeclarativeStateGroupPrivate::count_state(), QDeclarativeStateGroupPrivate::count_transitions(), QDeclarativeItemPrivate::data_append(), QDeclarativeFlickablePrivate::data_append(), QDeclarativeListReferencePrivate::init(), QDeclarativeVMEMetaObject::list_append(), QDeclarativeVMEMetaObject::list_clear(), QDeclarativeListScriptClass::newList(), QDeclarativeStatePrivate::operations_append(), QDeclarativeListProperty< QDeclarativeXmlListModelRole >::operator==(), QDeclarativeItemPrivate::resources_append(), QDeclarativeItemPrivate::resources_at(), QDeclarativeItemPrivate::resources_clear(), QDeclarativeItemPrivate::resources_count(), QDeclarativeItemPrivate::transform_append(), QDeclarativeItemPrivate::transform_at(), QDeclarativeItemPrivate::transform_clear(), and QDeclarativeItemPrivate::transform_count().