diff options
author | Thomas Hartmann <Thomas.Hartmann@nokia.com> | 2010-09-14 14:49:57 (GMT) |
---|---|---|
committer | Thomas Hartmann <Thomas.Hartmann@nokia.com> | 2010-09-14 14:49:57 (GMT) |
commit | 34b805d66c09fb324d1b6a7bcf259e8743ef3894 (patch) | |
tree | 3567ce5e2e8b0463c2e932e38940a92b814ab00c /src/gui/graphicsview/qgraphicsitem.cpp | |
parent | a8085e53f15f88aa108d2e7e6473094105d0fdcb (diff) | |
download | Qt-34b805d66c09fb324d1b6a7bcf259e8743ef3894.zip Qt-34b805d66c09fb324d1b6a7bcf259e8743ef3894.tar.gz Qt-34b805d66c09fb324d1b6a7bcf259e8743ef3894.tar.bz2 |
Completing the interface for children/data/resources
This patch makes the handling of properties like
children and data easier in Bauhaus.
Especially in the case of property alias
Reviewed-by: Aaron Kennedy
Diffstat (limited to 'src/gui/graphicsview/qgraphicsitem.cpp')
-rw-r--r-- | src/gui/graphicsview/qgraphicsitem.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp index 7a5b8de..9e43f2f 100644 --- a/src/gui/graphicsview/qgraphicsitem.cpp +++ b/src/gui/graphicsview/qgraphicsitem.cpp @@ -7676,6 +7676,13 @@ QGraphicsObject *QGraphicsItemPrivate::children_at(QDeclarativeListProperty<QGra return 0; } +void QGraphicsItemPrivate::children_clear(QDeclarativeListProperty<QGraphicsObject> *list) +{ + QGraphicsItemPrivate *d = QGraphicsItemPrivate::get(static_cast<QGraphicsObject *>(list->object)); + for (int index = 0 ;index < d->children.count();index++) + QGraphicsItemPrivate::get(d->children.at(index))->setParentItemHelper(0, /*newParentVariant=*/0, /*thisPointerVariant=*/0); +} + /*! Returns a list of this item's children. @@ -7689,7 +7696,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>(); |