summaryrefslogtreecommitdiffstats
path: root/src/widgets
diff options
context:
space:
mode:
authorAndy Shaw <andy.shaw@digia.com>2012-08-14 08:52:08 +0200
committerQt by Nokia <qt-info@nokia.com>2012-08-29 16:53:00 +0200
commit49c251e0543ea80e69d1725bb08bb4dfe3f225ab (patch)
tree51795737361ea372f10a1d483bf9cf49b80ff5e8 /src/widgets
parent48955161b47b1dbcb97a906a726dae9cc6d78c06 (diff)
Ensure child items are updated even if the parent item has no content
When a parent item had its visiblity toggled, then the child item would not update if the parent item had ItemHasNoContents and ItemClipsChildrenToShape set. This is a common use case in declarative as the root item has ItemHasNoContents set. Task-number: QTBUG-26846 Change-Id: Id6592ebc4ba2caa4331a4a71f7247e40993131b6 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Diffstat (limited to 'src/widgets')
-rw-r--r--src/widgets/graphicsview/qgraphicsitem.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/widgets/graphicsview/qgraphicsitem.cpp b/src/widgets/graphicsview/qgraphicsitem.cpp
index cdae6e35e0..a94752e7a6 100644
--- a/src/widgets/graphicsview/qgraphicsitem.cpp
+++ b/src/widgets/graphicsview/qgraphicsitem.cpp
@@ -2297,7 +2297,8 @@ void QGraphicsItemPrivate::setVisibleHelper(bool newVisible, bool explicitly, bo
}
// Update children with explicitly = false.
- const bool updateChildren = update && !(flags & QGraphicsItem::ItemClipsChildrenToShape);
+ const bool updateChildren = update && !((flags & QGraphicsItem::ItemClipsChildrenToShape)
+ && !(flags & QGraphicsItem::ItemHasNoContents));
foreach (QGraphicsItem *child, children) {
if (!newVisible || !child->d_ptr->explicitlyHidden)
child->d_ptr->setVisibleHelper(newVisible, false, updateChildren);