diff options
author | Rohan McGovern <rohan.mcgovern@nokia.com> | 2010-10-04 04:21:32 (GMT) |
---|---|---|
committer | Rohan McGovern <rohan.mcgovern@nokia.com> | 2010-10-04 04:21:32 (GMT) |
commit | 5171bb1613ecc537f3f0d0962532e3ee059b8870 (patch) | |
tree | 02d0e565d8fc397573a2d35845c11ba74b912c8d /src/gui/graphicsview/qgraphicsitem.cpp | |
parent | c372896c5293633d75674a320a9b715a0501a42d (diff) | |
parent | 33b76a659b2f44fa7038e375bbfb4cfd449ae617 (diff) | |
download | Qt-5171bb1613ecc537f3f0d0962532e3ee059b8870.zip Qt-5171bb1613ecc537f3f0d0962532e3ee059b8870.tar.gz Qt-5171bb1613ecc537f3f0d0962532e3ee059b8870.tar.bz2 |
Merge remote branch 'origin/4.7' into master-from-4.7
Conflicts:
doc/src/snippets/code/doc_src_qmake-manual.qdoc
src/corelib/arch/symbian/arch.pri
src/declarative/graphicsitems/qdeclarativeflickable.cpp
src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp
src/opengl/gl2paintengineex/qtextureglyphcache_gl_p.h
tests/auto/qfontmetrics/tst_qfontmetrics.cpp
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 096be63..ed163d7 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); + } } /*! |