diff options
author | Bjoern Erik Nilsen <bjorn.nilsen@nokia.com> | 2009-03-26 16:16:36 (GMT) |
---|---|---|
committer | Jason McDonald <jason.mcdonald@nokia.com> | 2009-04-15 10:21:03 (GMT) |
commit | 81f3767e24b95929c65fbd32cb24a9f30f3921cb (patch) | |
tree | 8e180d8de08895b5650426e944aec0ffa22819cd | |
parent | bb8b1a349b83c7f329daf9315a8795c38121f8e5 (diff) | |
download | Qt-81f3767e24b95929c65fbd32cb24a9f30f3921cb.zip Qt-81f3767e24b95929c65fbd32cb24a9f30f3921cb.tar.gz Qt-81f3767e24b95929c65fbd32cb24a9f30f3921cb.tar.bz2 |
Fixes: Don't bother updating hidden items.
AutoTest: Still pass
(cherry picked from commit d85835580463f88df6a71d27d2577739e5366f68)
-rw-r--r-- | src/gui/graphicsview/qgraphicsitem.cpp | 2 | ||||
-rw-r--r-- | src/gui/graphicsview/qgraphicsscene.cpp | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp index b05d1d1..9788bba 100644 --- a/src/gui/graphicsview/qgraphicsitem.cpp +++ b/src/gui/graphicsview/qgraphicsitem.cpp @@ -3652,7 +3652,7 @@ void QGraphicsItemPrivate::updateHelper(const QRectF &rect, bool force, bool may */ void QGraphicsItemPrivate::fullUpdateHelper(bool childrenOnly, bool maybeDirtyClipPath) { - if (!maybeDirtyClipPath && discardUpdateRequest()) + if (!visible || (!maybeDirtyClipPath && discardUpdateRequest())) return; // No scene, or if the scene is updating everything, means we have nothing // to do. The only exception is if the scene tracks the growing scene rect. diff --git a/src/gui/graphicsview/qgraphicsscene.cpp b/src/gui/graphicsview/qgraphicsscene.cpp index 4f533ce..9366c0e 100644 --- a/src/gui/graphicsview/qgraphicsscene.cpp +++ b/src/gui/graphicsview/qgraphicsscene.cpp @@ -5193,6 +5193,9 @@ void QGraphicsScene::itemUpdated(QGraphicsItem *item, const QRectF &rect) d->resetDirtyItemsLater(); } + if (!item->isVisible()) + return; // Hiding an item won't effect the largestUntransformableItem/sceneRect. + // Update d->largestUntransformableItem by mapping this item's bounding // rect back to the topmost untransformable item's untransformed // coordinate system (which sort of equals the 1:1 coordinate system of an |