summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLeonardo Sobral Cunha <leo.cunha@nokia.com>2010-01-28 14:43:12 (GMT)
committerLeonardo Sobral Cunha <leo.cunha@nokia.com>2010-01-29 16:25:09 (GMT)
commit37f1aec1a4e71a7102e8cd2e2908c8d3be7e29f5 (patch)
treeb0d7fc6eee76b65ee7e836b871f7b28e1ad2bc5c /src
parent08c649e6a81ab13d0c7db6aa1b480ed149e3f770 (diff)
downloadQt-37f1aec1a4e71a7102e8cd2e2908c8d3be7e29f5.zip
Qt-37f1aec1a4e71a7102e8cd2e2908c8d3be7e29f5.tar.gz
Qt-37f1aec1a4e71a7102e8cd2e2908c8d3be7e29f5.tar.bz2
Fixes missing update when setting opacity on an item that had opacity 0.0
We need to set the paintedViewBoundingRectsNeedRepaint flag when an item becomes visible again because when the item has opacity 0.0 the paintedViewBoundingRects struct can get set as outside of viewport, so the next time the item is set to visible again we need to diregard this cached data (otherwise the item will not be updated). Task-number: QTBUG-7714 Reviewed-by: bnilsen
Diffstat (limited to 'src')
-rw-r--r--src/gui/graphicsview/qgraphicsitem.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp
index 86780da..b4e19d1 100644
--- a/src/gui/graphicsview/qgraphicsitem.cpp
+++ b/src/gui/graphicsview/qgraphicsitem.cpp
@@ -2569,6 +2569,7 @@ void QGraphicsItem::setOpacity(qreal opacity)
if (newOpacity == d_ptr->opacity)
return;
+ bool wasFullyTransparent = d_ptr->isOpacityNull();
d_ptr->opacity = newOpacity;
// Notify change.
@@ -2585,6 +2586,8 @@ void QGraphicsItem::setOpacity(qreal opacity)
/*invalidateChildren=*/true,
/*force=*/false,
/*ignoreOpacity=*/d_ptr->isOpacityNull());
+ if (wasFullyTransparent)
+ d_ptr->paintedViewBoundingRectsNeedRepaint = 1;
}
if (d_ptr->isObject)