diff options
author | Yoann Lopes <yoann.lopes@nokia.com> | 2009-12-30 12:44:58 (GMT) |
---|---|---|
committer | Yoann Lopes <yoann.lopes@nokia.com> | 2009-12-30 12:59:07 (GMT) |
commit | 2600fd42117913b427d07e510724b0ea5e355205 (patch) | |
tree | fe1ddbc49e86e7ed89830432bd1c6ced1f6cf9ac | |
parent | 16b41824dceb1cecfe54089d88af787af134af8a (diff) | |
download | Qt-2600fd42117913b427d07e510724b0ea5e355205.zip Qt-2600fd42117913b427d07e510724b0ea5e355205.tar.gz Qt-2600fd42117913b427d07e510724b0ea5e355205.tar.bz2 |
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
-rw-r--r-- | src/gui/graphicsview/qgraphicsview.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gui/graphicsview/qgraphicsview.cpp b/src/gui/graphicsview/qgraphicsview.cpp index 3bb40fb..1569078 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(); } |