diff options
author | Bjoern Erik Nilsen <bjorn.nilsen@nokia.com> | 2009-03-26 16:16:36 (GMT) |
---|---|---|
committer | Andreas Aardal Hanssen <andreas.aardal.hanssen@nokia.com> | 2009-04-06 11:49:50 (GMT) |
commit | d85835580463f88df6a71d27d2577739e5366f68 (patch) | |
tree | 45fd640b1b6b6a913cb41749e59b3a2085c6f7eb | |
parent | 15098c5ec73db5de8ca724f744a1484f888ed271 (diff) | |
download | Qt-d85835580463f88df6a71d27d2577739e5366f68.zip Qt-d85835580463f88df6a71d27d2577739e5366f68.tar.gz Qt-d85835580463f88df6a71d27d2577739e5366f68.tar.bz2 |
Fixes: Don't bother updating hidden items.
AutoTest: Still pass
-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 b4f36de..327b352 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 f32fe71..e13a767 100644 --- a/src/gui/graphicsview/qgraphicsscene.cpp +++ b/src/gui/graphicsview/qgraphicsscene.cpp @@ -5174,6 +5174,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 |