diff options
author | Andy Shaw <andy.shaw@digia.com> | 2012-08-14 06:52:08 (GMT) |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-09-12 11:40:18 (GMT) |
commit | 111889ea5a1b40e3dc54380298096a978e9a5684 (patch) | |
tree | 6ef810dfc147fd67a0a2081037791cb8c9e8b47b /src/gui/graphicsview | |
parent | 3dc047a4e11d2b18259d3ee383e81147c9098cb7 (diff) | |
download | Qt-111889ea5a1b40e3dc54380298096a978e9a5684.zip Qt-111889ea5a1b40e3dc54380298096a978e9a5684.tar.gz Qt-111889ea5a1b40e3dc54380298096a978e9a5684.tar.bz2 |
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/gui/graphicsview')
-rw-r--r-- | src/gui/graphicsview/qgraphicsitem.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp index ef5527b..02cd13e 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); |