diff options
author | Yoann Lopes <yoann.lopes@nokia.com> | 2009-12-30 12:44:58 (GMT) |
---|---|---|
committer | Jason McDonald <jason.mcdonald@nokia.com> | 2010-01-07 10:40:42 (GMT) |
commit | 796a9c9704965c7dd89f059c762ace57e5931dea (patch) | |
tree | 35cbbeba0c0064825a64e661c2d459525e1f2329 | |
parent | 00bb82912aecd664d14ea8d3d0d1d964db7a36d6 (diff) | |
download | Qt-796a9c9704965c7dd89f059c762ace57e5931dea.zip Qt-796a9c9704965c7dd89f059c762ace57e5931dea.tar.gz Qt-796a9c9704965c7dd89f059c762ace57e5931dea.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
(cherry picked from commit 2600fd42117913b427d07e510724b0ea5e355205)
-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 a7c62c0..cc5f257 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(); } |