summaryrefslogtreecommitdiff
path: root/src/gui/graphicsview
diff options
context:
space:
mode:
authorYoann Lopes <yoann.lopes@nokia.com>2009-12-30 13:44:58 +0100
committerYoann Lopes <yoann.lopes@nokia.com>2009-12-30 13:59:07 +0100
commit2600fd42117913b427d07e510724b0ea5e355205 (patch)
treefe1ddbc49e86e7ed89830432bd1c6ced1f6cf9ac /src/gui/graphicsview
parent16b41824dceb1cecfe54089d88af787af134af8a (diff)
downloadqt4-tools-2600fd42117913b427d07e510724b0ea5e355205.tar.gz
Fixes painting artifacts when using CacheBackground in a QGraphicsView.
The problem was that when the background cache was invalidated, it was entirely recreated but only the exposed area of the view was repainted in it, causing the cache to be partly empty in some cases. Now the background cache is always fully repainted when it is invalidated. Task-number: QTBUG-6935 Reviewed-by: ogoffart
Diffstat (limited to 'src/gui/graphicsview')
-rw-r--r--src/gui/graphicsview/qgraphicsview.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gui/graphicsview/qgraphicsview.cpp b/src/gui/graphicsview/qgraphicsview.cpp
index 3bb40fbe7a..1569078fac 100644
--- a/src/gui/graphicsview/qgraphicsview.cpp
+++ b/src/gui/graphicsview/qgraphicsview.cpp
@@ -3365,7 +3365,8 @@ void QGraphicsView::paintEvent(QPaintEvent *event)
#define X11 qt_x11Data
#endif
backgroundPainter.setCompositionMode(QPainter::CompositionMode_Source);
- drawBackground(&backgroundPainter, exposedSceneRect);
+ QRectF backgroundExposedSceneRect = mapToScene(d->backgroundPixmapExposed.boundingRect()).boundingRect();
+ drawBackground(&backgroundPainter, backgroundExposedSceneRect);
d->backgroundPixmapExposed = QRegion();
}