diff options
author | Morten Engvoldsen <morten.engvoldsen@nokia.com> | 2010-10-06 11:12:30 (GMT) |
---|---|---|
committer | Morten Engvoldsen <morten.engvoldsen@nokia.com> | 2010-10-06 11:12:30 (GMT) |
commit | eaef6f8b4a7ad637a59b4fe2ec623d26a7cae96f (patch) | |
tree | 4868b097a6e1d5814ae557c464f70c879ffd8e9d /src/gui/graphicsview/qgraphicsitem.cpp | |
parent | fe0319a84082cb97a2007ca82af153a785a0938e (diff) | |
parent | 24c89f6d1c090ab670d4f883d06cd0413c2ecc65 (diff) | |
download | Qt-eaef6f8b4a7ad637a59b4fe2ec623d26a7cae96f.zip Qt-eaef6f8b4a7ad637a59b4fe2ec623d26a7cae96f.tar.gz Qt-eaef6f8b4a7ad637a59b4fe2ec623d26a7cae96f.tar.bz2 |
Merge branch '4.7' of git@scm.dev.nokia.troll.no:qt/qt-doc-team into 4.7
Diffstat (limited to 'src/gui/graphicsview/qgraphicsitem.cpp')
-rw-r--r-- | src/gui/graphicsview/qgraphicsitem.cpp | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp index b404692..fc44a44 100644 --- a/src/gui/graphicsview/qgraphicsitem.cpp +++ b/src/gui/graphicsview/qgraphicsitem.cpp @@ -6655,6 +6655,11 @@ bool QGraphicsItem::sceneEvent(QEvent *event) return true; } + if (event->type() == QEvent::FocusOut) { + focusOutEvent(static_cast<QFocusEvent *>(event)); + return true; + } + if (!d_ptr->visible) { // Eaten return true; @@ -6664,9 +6669,6 @@ bool QGraphicsItem::sceneEvent(QEvent *event) case QEvent::FocusIn: focusInEvent(static_cast<QFocusEvent *>(event)); break; - case QEvent::FocusOut: - focusOutEvent(static_cast<QFocusEvent *>(event)); - break; case QEvent::GraphicsSceneContextMenu: contextMenuEvent(static_cast<QGraphicsSceneContextMenuEvent *>(event)); break; @@ -7669,7 +7671,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 +7698,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); + } } /*! |