summaryrefslogtreecommitdiffstats
path: root/src/gui/graphicsview/qgraphicsscene.cpp
diff options
context:
space:
mode:
authorJørgen Lind <jorgen.lind@nokia.com>2009-11-02 10:01:08 (GMT)
committerJørgen Lind <jorgen.lind@nokia.com>2009-11-02 10:01:08 (GMT)
commit5e0bdffd92cbff2a9eb551f77850a24bf2a2116a (patch)
treefcf764b8326d8282e7f194a4fe1b2a88a7082319 /src/gui/graphicsview/qgraphicsscene.cpp
parentb68cd1df21935fc032a93c7d7bc33fcb77c7b8cd (diff)
parent5d7e254583551659df42e59fab4756994d4211ed (diff)
downloadQt-5e0bdffd92cbff2a9eb551f77850a24bf2a2116a.zip
Qt-5e0bdffd92cbff2a9eb551f77850a24bf2a2116a.tar.gz
Qt-5e0bdffd92cbff2a9eb551f77850a24bf2a2116a.tar.bz2
Merge commit 'origin/4.6' into feature
Diffstat (limited to 'src/gui/graphicsview/qgraphicsscene.cpp')
-rw-r--r--src/gui/graphicsview/qgraphicsscene.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/gui/graphicsview/qgraphicsscene.cpp b/src/gui/graphicsview/qgraphicsscene.cpp
index 1e4fe6f..f982f4b 100644
--- a/src/gui/graphicsview/qgraphicsscene.cpp
+++ b/src/gui/graphicsview/qgraphicsscene.cpp
@@ -525,6 +525,14 @@ void QGraphicsScenePrivate::removeItemHelper(QGraphicsItem *item)
item->d_func()->scene = 0;
+ //We need to remove all children first because they might use their parent
+ //attributes (e.g. sceneTransform).
+ if (!item->d_ptr->inDestructor) {
+ // Remove all children recursively
+ for (int i = 0; i < item->d_ptr->children.size(); ++i)
+ q->removeItem(item->d_ptr->children.at(i));
+ }
+
// Unregister focus proxy.
item->d_ptr->resetFocusProxy();
@@ -571,12 +579,6 @@ void QGraphicsScenePrivate::removeItemHelper(QGraphicsItem *item)
++iterator;
}
- if (!item->d_ptr->inDestructor) {
- // Remove all children recursively
- for (int i = 0; i < item->d_ptr->children.size(); ++i)
- q->removeItem(item->d_ptr->children.at(i));
- }
-
if (item->isPanel() && item->isVisible() && item->panelModality() != QGraphicsItem::NonModal)
leaveModal(item);
@@ -4912,7 +4914,7 @@ void QGraphicsScenePrivate::processDirtyItemsRecursive(QGraphicsItem *item, bool
continue;
}
- if (item->d_ptr->paintedViewBoundingRectsNeedRepaint && !paintedViewBoundingRect.isEmpty()) {
+ if (item->d_ptr->paintedViewBoundingRectsNeedRepaint) {
paintedViewBoundingRect.translate(viewPrivate->dirtyScrollOffset);
if (!viewPrivate->updateRect(paintedViewBoundingRect))
paintedViewBoundingRect = QRect(-1, -1, -1, -1); // Outside viewport.