summaryrefslogtreecommitdiffstats
path: root/src/gui/graphicsview/qgraphicsitem.cpp
diff options
context:
space:
mode:
authorAlexis Menard <alexis.menard@nokia.com>2010-04-14 05:48:40 (GMT)
committerAlexis Menard <alexis.menard@nokia.com>2010-04-14 05:48:40 (GMT)
commit2333ad8b4b93337c2515bc673b100c47b45e516b (patch)
treea338e4682dc857658824e7f07efe9ca57e4b9d0e /src/gui/graphicsview/qgraphicsitem.cpp
parentc6483baf226e9e698983aa596761825ad4a8a698 (diff)
parent37581fa549c5cbe56afc68c71fa97d8f933512c0 (diff)
downloadQt-2333ad8b4b93337c2515bc673b100c47b45e516b.zip
Qt-2333ad8b4b93337c2515bc673b100c47b45e516b.tar.gz
Qt-2333ad8b4b93337c2515bc673b100c47b45e516b.tar.bz2
Merge branch '4.7' into reviews/2361
Conflicts: src/declarative/graphicsitems/qdeclarativeitem.h
Diffstat (limited to 'src/gui/graphicsview/qgraphicsitem.cpp')
-rw-r--r--src/gui/graphicsview/qgraphicsitem.cpp20
1 files changed, 18 insertions, 2 deletions
diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp
index d6daf4d..150343e 100644
--- a/src/gui/graphicsview/qgraphicsitem.cpp
+++ b/src/gui/graphicsview/qgraphicsitem.cpp
@@ -7615,11 +7615,26 @@ void QGraphicsObject::updateMicroFocus()
QGraphicsItem::updateMicroFocus();
}
-void QGraphicsItemPrivate::append(QDeclarativeListProperty<QGraphicsObject> *list, QGraphicsObject *item)
+void QGraphicsItemPrivate::children_append(QDeclarativeListProperty<QGraphicsObject> *list, QGraphicsObject *item)
{
QGraphicsItemPrivate::get(item)->setParentItemHelper(static_cast<QGraphicsObject *>(list->object), /*newParentVariant=*/0, /*thisPointerVariant=*/0);
}
+int QGraphicsItemPrivate::children_count(QDeclarativeListProperty<QGraphicsObject> *list)
+{
+ QGraphicsItemPrivate *d = QGraphicsItemPrivate::get(static_cast<QGraphicsObject *>(list->object));
+ return d->children.count();
+}
+
+QGraphicsObject *QGraphicsItemPrivate::children_at(QDeclarativeListProperty<QGraphicsObject> *list, int index)
+{
+ QGraphicsItemPrivate *d = QGraphicsItemPrivate::get(static_cast<QGraphicsObject *>(list->object));
+ if (index >= 0 && index < d->children.count())
+ return d->children.at(index)->toGraphicsObject();
+ else
+ return 0;
+}
+
/*!
Returns a list of this item's children.
@@ -7632,7 +7647,8 @@ QDeclarativeListProperty<QGraphicsObject> QGraphicsItemPrivate::childrenList()
Q_Q(QGraphicsItem);
if (isObject) {
QGraphicsObject *that = static_cast<QGraphicsObject *>(q);
- return QDeclarativeListProperty<QGraphicsObject>(that, &children, QGraphicsItemPrivate::append);
+ return QDeclarativeListProperty<QGraphicsObject>(that, &children, children_append,
+ children_count, children_at);
} else {
//QGraphicsItem is not supported for this property
return QDeclarativeListProperty<QGraphicsObject>();