summaryrefslogtreecommitdiffstats
path: root/src/gui/graphicsview/qgraphicsscene.cpp
diff options
context:
space:
mode:
authorBjørn Erik Nilsen <bjorn.nilsen@nokia.com>2009-09-03 14:03:15 (GMT)
committerBjørn Erik Nilsen <bjorn.nilsen@nokia.com>2009-09-03 14:33:20 (GMT)
commitf360180890298618ef3284c08789c2a243e1ba9d (patch)
tree082b4b067bd7c1d337762e28e32803fcffa2dbc1 /src/gui/graphicsview/qgraphicsscene.cpp
parent6dce8c6548aa63fd11ca326b8a54d5623a41573c (diff)
downloadQt-f360180890298618ef3284c08789c2a243e1ba9d.zip
Qt-f360180890298618ef3284c08789c2a243e1ba9d.tar.gz
Qt-f360180890298618ef3284c08789c2a243e1ba9d.tar.bz2
Rendering artifacts when installing an effect on HasNoContents items.
QGraphicsItem::HasNoContents is documented to not paint anything when the flag is set on an item, so all the update requests are ignored. However, we cannot ignore update requests on such items when an effect is installed on them, because when the effects changes parameters it calls update on the item. We still don't paint the item, but we processes the update request such that its children can be painted properly. Reviewed-by: Andreas
Diffstat (limited to 'src/gui/graphicsview/qgraphicsscene.cpp')
-rw-r--r--src/gui/graphicsview/qgraphicsscene.cpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/gui/graphicsview/qgraphicsscene.cpp b/src/gui/graphicsview/qgraphicsscene.cpp
index 2ac1dca..5dd71e2 100644
--- a/src/gui/graphicsview/qgraphicsscene.cpp
+++ b/src/gui/graphicsview/qgraphicsscene.cpp
@@ -4616,7 +4616,8 @@ void QGraphicsScenePrivate::markDirty(QGraphicsItem *item, const QRectF &rect, b
return;
}
- bool hasNoContents = item->d_ptr->flags & QGraphicsItem::ItemHasNoContents;
+ bool hasNoContents = item->d_ptr->flags & QGraphicsItem::ItemHasNoContents
+ && !item->d_ptr->graphicsEffect;
if (!hasNoContents) {
item->d_ptr->dirty = 1;
if (fullItemUpdate)
@@ -4706,11 +4707,15 @@ void QGraphicsScenePrivate::processDirtyItemsRecursive(QGraphicsItem *item, bool
return;
}
- const bool itemHasContents = !(item->d_ptr->flags & QGraphicsItem::ItemHasNoContents);
+ bool itemHasContents = !(item->d_ptr->flags & QGraphicsItem::ItemHasNoContents);
const bool itemHasChildren = !item->d_ptr->children.isEmpty();
- if (!itemHasContents && !itemHasChildren) {
- resetDirtyItem(item);
- return; // Item has neither contents nor children!(?)
+ if (!itemHasContents) {
+ if (!itemHasChildren) {
+ resetDirtyItem(item);
+ return; // Item has neither contents nor children!(?)
+ }
+ if (item->d_ptr->graphicsEffect)
+ itemHasContents = true;
}
const qreal opacity = item->d_ptr->combineOpacityFromParent(parentOpacity);