summaryrefslogtreecommitdiff
path: root/src
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-09-12 13:40:18 +0200
commit111889ea5a1b40e3dc54380298096a978e9a5684 (patch)
tree6ef810dfc147fd67a0a2081037791cb8c9e8b47b /src
parent3dc047a4e11d2b18259d3ee383e81147c9098cb7 (diff)
downloadqt4-tools-111889ea5a1b40e3dc54380298096a978e9a5684.tar.gz
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> (cherry picked from commit 49c251e0543ea80e69d1725bb08bb4dfe3f225ab)
Diffstat (limited to 'src')
-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 ef5527b3e8..02cd13ee2e 100644
--- a/src/gui/graphicsview/qgraphicsitem.cpp
+++ b/src/gui/graphicsview/qgraphicsitem.cpp
@@ -2348,7 +2348,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);