summaryrefslogtreecommitdiffstats
path: root/src/gui/graphicsview/qgraphicsitem.cpp
diff options
context:
space:
mode:
authorYoann Lopes <yoann.lopes@nokia.com>2010-03-25 13:27:56 (GMT)
committerYoann Lopes <yoann.lopes@nokia.com>2010-03-25 13:33:11 (GMT)
commit96ac1964b827ef01ef2edb6411ecb7540ed76ce2 (patch)
tree775fadd51dbb921fab0f654ed5ab73cd9d4058f0 /src/gui/graphicsview/qgraphicsitem.cpp
parentc84d5afab9b61ae3f955de48a75c8dfd26528a36 (diff)
downloadQt-96ac1964b827ef01ef2edb6411ecb7540ed76ce2.zip
Qt-96ac1964b827ef01ef2edb6411ecb7540ed76ce2.tar.gz
Qt-96ac1964b827ef01ef2edb6411ecb7540ed76ce2.tar.bz2
Prevents a useless repaint with QGraphicsItem cache mode.
No repaint is triggered anymore when setting the cache mode to DeviceCoordinateMode when already using that mode. Also added an autotest for checking repaints when setting cache modes. Task-number: QTBUG-9391 Reviewed-by: ahanssen
Diffstat (limited to 'src/gui/graphicsview/qgraphicsitem.cpp')
-rw-r--r--src/gui/graphicsview/qgraphicsitem.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp
index f110a5c..1b707b0 100644
--- a/src/gui/graphicsview/qgraphicsitem.cpp
+++ b/src/gui/graphicsview/qgraphicsitem.cpp
@@ -1883,7 +1883,8 @@ void QGraphicsItem::setCacheMode(CacheMode mode, const QSize &logicalCacheSize)
d_ptr->cacheMode = mode;
bool noVisualChange = (mode == NoCache && lastMode == NoCache)
|| (mode == NoCache && lastMode == DeviceCoordinateCache)
- || (mode == DeviceCoordinateCache && lastMode == NoCache);
+ || (mode == DeviceCoordinateCache && lastMode == NoCache)
+ || (mode == DeviceCoordinateCache && lastMode == DeviceCoordinateCache);
if (mode == NoCache) {
d_ptr->removeExtraItemCache();
} else {