diff options
author | Aaron Kennedy <aaron.kennedy@nokia.com> | 2010-03-02 01:17:02 (GMT) |
---|---|---|
committer | Aaron Kennedy <aaron.kennedy@nokia.com> | 2010-03-02 01:17:02 (GMT) |
commit | a9d327db7e77cc167172ad3199b6ffbc1c9da74f (patch) | |
tree | cdeeb4ee18e8421a5eac93151a33349925098359 | |
parent | adc06e50e1ebb65e9facc58ad01aaa8e879efe6e (diff) | |
download | Qt-a9d327db7e77cc167172ad3199b6ffbc1c9da74f.zip Qt-a9d327db7e77cc167172ad3199b6ffbc1c9da74f.tar.gz Qt-a9d327db7e77cc167172ad3199b6ffbc1c9da74f.tar.bz2 |
Add accessor operations to VisualItemModel::children
-rw-r--r-- | src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp b/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp index 59d6db8..a0aed46 100644 --- a/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp +++ b/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp @@ -81,6 +81,14 @@ public: static_cast<QDeclarativeVisualItemModelPrivate *>(prop->data)->emitChildrenChanged(); } + static int children_count(QDeclarativeListProperty<QDeclarativeItem> *prop) { + return static_cast<QDeclarativeVisualItemModelPrivate *>(prop->data)->children.count(); + } + + static QDeclarativeItem *children_at(QDeclarativeListProperty<QDeclarativeItem> *prop, int index) { + return static_cast<QDeclarativeVisualItemModelPrivate *>(prop->data)->children.at(index); + } + void itemAppended() { Q_Q(QDeclarativeVisualItemModel); QDeclarativeVisualItemModelAttached *attached = QDeclarativeVisualItemModelAttached::properties(children.last()); @@ -136,7 +144,8 @@ QDeclarativeVisualItemModel::QDeclarativeVisualItemModel() QDeclarativeListProperty<QDeclarativeItem> QDeclarativeVisualItemModel::children() { Q_D(QDeclarativeVisualItemModel); - return QDeclarativeListProperty<QDeclarativeItem>(this, d, QDeclarativeVisualItemModelPrivate::children_append); + return QDeclarativeListProperty<QDeclarativeItem>(this, d, d->children_append, + d->children_count, d->children_at); } /*! |