diff options
author | A-Team <ateam@pad.test.qt.nokia.com> | 2010-09-16 22:00:18 (GMT) |
---|---|---|
committer | A-Team <ateam@pad.test.qt.nokia.com> | 2010-09-16 22:00:18 (GMT) |
commit | 0f71215693713fef4fd9dabeae8e6a574deff415 (patch) | |
tree | 27d8a11e29f87813df5cbb644389cbfdfebc1abb /src/gui/graphicsview/qgraphicsitem.cpp | |
parent | acab3259e9f57e436f475b4c0d1d7e7fb194e983 (diff) | |
parent | fc007d0a99cc52e673c5d2606e5076831f6103b1 (diff) | |
download | Qt-0f71215693713fef4fd9dabeae8e6a574deff415.zip Qt-0f71215693713fef4fd9dabeae8e6a574deff415.tar.gz Qt-0f71215693713fef4fd9dabeae8e6a574deff415.tar.bz2 |
Merge branch '4.7-upstream' into 4.7-doc
Diffstat (limited to 'src/gui/graphicsview/qgraphicsitem.cpp')
-rw-r--r-- | src/gui/graphicsview/qgraphicsitem.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp index 7a5b8de..2600d06 100644 --- a/src/gui/graphicsview/qgraphicsitem.cpp +++ b/src/gui/graphicsview/qgraphicsitem.cpp @@ -7676,6 +7676,14 @@ QGraphicsObject *QGraphicsItemPrivate::children_at(QDeclarativeListProperty<QGra return 0; } +void QGraphicsItemPrivate::children_clear(QDeclarativeListProperty<QGraphicsObject> *list) +{ + QGraphicsItemPrivate *d = QGraphicsItemPrivate::get(static_cast<QGraphicsObject *>(list->object)); + int childCount = d->children.count(); + for (int index = 0; index < childCount; index++) + QGraphicsItemPrivate::get(d->children.at(0))->setParentItemHelper(0, /*newParentVariant=*/0, /*thisPointerVariant=*/0); +} + /*! Returns a list of this item's children. @@ -7689,7 +7697,7 @@ QDeclarativeListProperty<QGraphicsObject> QGraphicsItemPrivate::childrenList() if (isObject) { QGraphicsObject *that = static_cast<QGraphicsObject *>(q); return QDeclarativeListProperty<QGraphicsObject>(that, &children, children_append, - children_count, children_at); + children_count, children_at, children_clear); } else { //QGraphicsItem is not supported for this property return QDeclarativeListProperty<QGraphicsObject>(); |