diff options
author | David Boddie <david.boddie@nokia.com> | 2010-10-01 17:53:25 (GMT) |
---|---|---|
committer | David Boddie <david.boddie@nokia.com> | 2010-10-01 17:53:25 (GMT) |
commit | 4cdaadb332a49513d6082b6ea723dc1968b3ad30 (patch) | |
tree | fbcbf013e29ad3e4c718dca5ca2dc25d2f9498ff /src/gui/graphicsview/qgraphicsitem.cpp | |
parent | 7799c68a964dd9a26cc98fa4b810fce7cc333e27 (diff) | |
parent | 5d95b43762a16a37a20b3288c74976f6e62075d3 (diff) | |
download | Qt-4cdaadb332a49513d6082b6ea723dc1968b3ad30.zip Qt-4cdaadb332a49513d6082b6ea723dc1968b3ad30.tar.gz Qt-4cdaadb332a49513d6082b6ea723dc1968b3ad30.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.7
Diffstat (limited to 'src/gui/graphicsview/qgraphicsitem.cpp')
-rw-r--r-- | src/gui/graphicsview/qgraphicsitem.cpp | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp index b404692..3b18c31 100644 --- a/src/gui/graphicsview/qgraphicsitem.cpp +++ b/src/gui/graphicsview/qgraphicsitem.cpp @@ -7669,7 +7669,12 @@ void QGraphicsObject::updateMicroFocus() void QGraphicsItemPrivate::children_append(QDeclarativeListProperty<QGraphicsObject> *list, QGraphicsObject *item) { - QGraphicsItemPrivate::get(item)->setParentItemHelper(static_cast<QGraphicsObject *>(list->object), /*newParentVariant=*/0, /*thisPointerVariant=*/0); + QGraphicsObject *graphicsObject = static_cast<QGraphicsObject *>(list->object); + if (QGraphicsItemPrivate::get(graphicsObject)->sendParentChangeNotification) { + item->setParentItem(graphicsObject); + } else { + QGraphicsItemPrivate::get(item)->setParentItemHelper(graphicsObject, 0, 0); + } } int QGraphicsItemPrivate::children_count(QDeclarativeListProperty<QGraphicsObject> *list) @@ -7691,8 +7696,13 @@ void QGraphicsItemPrivate::children_clear(QDeclarativeListProperty<QGraphicsObje { 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); + if (d->sendParentChangeNotification) { + for (int index = 0; index < childCount; index++) + d->children.at(0)->setParentItem(0); + } else { + for (int index = 0; index < childCount; index++) + QGraphicsItemPrivate::get(d->children.at(0))->setParentItemHelper(0, 0, 0); + } } /*! |