diff options
author | Bjørn Erik Nilsen <bjorn.nilsen@nokia.com> | 2009-07-14 11:03:10 (GMT) |
---|---|---|
committer | Bjørn Erik Nilsen <bjorn.nilsen@nokia.com> | 2009-07-14 11:32:47 (GMT) |
commit | a2bad25383e565233a0c2527e04cef9f6b577f14 (patch) | |
tree | e62e3c89500eaccedb19b864b1351f0d19a8b910 /src/gui/graphicsview/qgraphicsview.cpp | |
parent | 9210e8cdc83b6812d10f5f5847d05703ef2e5f7c (diff) | |
download | Qt-a2bad25383e565233a0c2527e04cef9f6b577f14.zip Qt-a2bad25383e565233a0c2527e04cef9f6b577f14.tar.gz Qt-a2bad25383e565233a0c2527e04cef9f6b577f14.tar.bz2 |
Make sure QGraphicsScene::update() only requires one event-loop
iteration before the views are updated.
A full scene update (scene.update()) already supported it because the
scene called update() on the views directly. However, partially scene
updates (scene.update(rect)) required two event-loop iterations
before the views were updated.
Auto-test included.
Diffstat (limited to 'src/gui/graphicsview/qgraphicsview.cpp')
-rw-r--r-- | src/gui/graphicsview/qgraphicsview.cpp | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/gui/graphicsview/qgraphicsview.cpp b/src/gui/graphicsview/qgraphicsview.cpp index bcfd68c..1cea8db 100644 --- a/src/gui/graphicsview/qgraphicsview.cpp +++ b/src/gui/graphicsview/qgraphicsview.cpp @@ -821,13 +821,9 @@ void QGraphicsViewPrivate::processPendingUpdates() if (!scene) return; - if (fullUpdatePending) { // We have already called viewport->update() - dirtyBoundingRect = QRect(); - dirtyRegion = QRegion(); - return; - } - - if (viewportUpdateMode == QGraphicsView::BoundingRectViewportUpdate) { + if (fullUpdatePending) { + viewport->update(); + } else if (viewportUpdateMode == QGraphicsView::BoundingRectViewportUpdate) { if (optimizationFlags & QGraphicsView::DontAdjustForAntialiasing) viewport->update(dirtyBoundingRect.adjusted(-1, -1, 1, 1)); else |