summaryrefslogtreecommitdiffstats
path: root/src/gui/graphicsview/qgraphicsscene.cpp
diff options
context:
space:
mode:
authorBjørn Erik Nilsen <bjorn.nilsen@nokia.com>2010-09-22 15:52:13 (GMT)
committerBjørn Erik Nilsen <bjorn.nilsen@nokia.com>2010-09-22 17:09:41 (GMT)
commiteaeaba06cea2ca0668a3c904744bab06b11077d0 (patch)
tree580421c42e0172ec5e26252aa81dc7900342d5a0 /src/gui/graphicsview/qgraphicsscene.cpp
parenta8ddc56b1d80b16a3229286d7f0e02323c4203bc (diff)
downloadQt-eaeaba06cea2ca0668a3c904744bab06b11077d0.zip
Qt-eaeaba06cea2ca0668a3c904744bab06b11077d0.tar.gz
Qt-eaeaba06cea2ca0668a3c904744bab06b11077d0.tar.bz2
QPainter not restored correctly in Graphics View.
World transform and opacity was sometimes not restored correctly after drawing items. Auto test included. Task-number: Discovered while working on QTBUG-12760
Diffstat (limited to 'src/gui/graphicsview/qgraphicsscene.cpp')
-rw-r--r--src/gui/graphicsview/qgraphicsscene.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/gui/graphicsview/qgraphicsscene.cpp b/src/gui/graphicsview/qgraphicsscene.cpp
index 38612a8..8dc15bf 100644
--- a/src/gui/graphicsview/qgraphicsscene.cpp
+++ b/src/gui/graphicsview/qgraphicsscene.cpp
@@ -5305,6 +5305,7 @@ void QGraphicsScene::drawItems(QPainter *painter,
if (!d->unpolishedItems.isEmpty())
d->_q_polishItems();
+ const qreal opacity = painter->opacity();
QTransform viewTransform = painter->worldTransform();
Q_UNUSED(options);
@@ -5338,6 +5339,7 @@ void QGraphicsScene::drawItems(QPainter *painter,
topLevelItems.at(i)->d_ptr->itemDiscovered = 0;
painter->setWorldTransform(viewTransform);
+ painter->setOpacity(opacity);
}
/*!