summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authordiaulas <diau@phobos.diaunet>2009-05-12 12:15:34 (GMT)
committerLeonardo Sobral Cunha <leo.cunha@nokia.com>2009-05-27 12:49:07 (GMT)
commit3a61a448b92b4f7c7ee02196340d3bcb75d067fb (patch)
tree61373a6300495bc69626125785b9193dbc97872a /src/gui
parent2c1b11f2192fd48da01a1093a7cb4a848de43c8a (diff)
downloadQt-3a61a448b92b4f7c7ee02196340d3bcb75d067fb.zip
Qt-3a61a448b92b4f7c7ee02196340d3bcb75d067fb.tar.gz
Qt-3a61a448b92b4f7c7ee02196340d3bcb75d067fb.tar.bz2
Dont show children when parent is not visible in QGraphicsItem
When setVisible() is called on a QGraphicsItem, if the parent of that item was hidden, the child shouldn't be actually shown. Task-number: 197802 Reviewed-by: leo Reviewed-by: alexis
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/graphicsview/qgraphicsitem.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp
index 4908296..b6a7386 100644
--- a/src/gui/graphicsview/qgraphicsitem.cpp
+++ b/src/gui/graphicsview/qgraphicsitem.cpp
@@ -1522,6 +1522,11 @@ void QGraphicsItemPrivate::setVisibleHelper(bool newVisible, bool explicitly, bo
if (visible == quint32(newVisible))
return;
+ QGraphicsItem *parent(q_ptr->parentItem());
+ if (parent && newVisible && !parent->d_ptr->visible) {
+ return;
+ }
+
// Modify the property.
const QVariant newVisibleVariant(q_ptr->itemChange(QGraphicsItem::ItemVisibleChange,
quint32(newVisible)));