summaryrefslogtreecommitdiffstats
path: root/src/gui/graphicsview/qgraphicsview.cpp
diff options
context:
space:
mode:
authorGunnar Sletta <gunnar@trolltech.com>2009-11-03 11:52:16 (GMT)
committerGunnar Sletta <gunnar@trolltech.com>2009-11-03 11:52:16 (GMT)
commit2e02518498379fc691a27ec96ae182aff436a38d (patch)
tree1ed6ce158c8de6507b36ae2b70133edbc6beca5d /src/gui/graphicsview/qgraphicsview.cpp
parentfc4a3206fd89d28c0b0c6c36fa0c136a65e2e057 (diff)
parent9fab0ede200960f0dbec1457757a6ba3214c3ce6 (diff)
downloadQt-2e02518498379fc691a27ec96ae182aff436a38d.zip
Qt-2e02518498379fc691a27ec96ae182aff436a38d.tar.gz
Qt-2e02518498379fc691a27ec96ae182aff436a38d.tar.bz2
Merge branch '4.6' of git@scm.dev.nokia.troll.no:qt/qt into 4.6
Diffstat (limited to 'src/gui/graphicsview/qgraphicsview.cpp')
-rw-r--r--src/gui/graphicsview/qgraphicsview.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/gui/graphicsview/qgraphicsview.cpp b/src/gui/graphicsview/qgraphicsview.cpp
index 8945f51..c88f678 100644
--- a/src/gui/graphicsview/qgraphicsview.cpp
+++ b/src/gui/graphicsview/qgraphicsview.cpp
@@ -3325,6 +3325,14 @@ void QGraphicsView::paintEvent(QPaintEvent *event)
if (!(d->optimizationFlags & IndirectPainting)) {
d->scene->d_func()->drawItems(&painter, viewTransformed ? &viewTransform : 0,
&d->exposedRegion, viewport());
+ // Make sure the painter's world transform is restored correctly when
+ // drawing without painter state protection (DontSavePainterState).
+ // We only change the worldTransform() so there's no need to do a full-blown
+ // save() and restore(). Also note that we don't have to do this in case of
+ // IndirectPainting (the else branch), because in that case we always save()
+ // and restore() in QGraphicsScene::drawItems().
+ if (!d->scene->d_func()->painterStateProtection)
+ painter.setWorldTransform(viewTransform);
} else {
// Find all exposed items
bool allItems = false;