qt/0285-qgv-dontshowchildren.diff

25 lines
1013 B
Diff
Raw Normal View History

2009-10-10 21:13:22 +00:00
qt-bugs@ issue : unknows
Qt Software task ID : 197802
bugs.kde.org number : bugs on the issue not reported yed
applied: no
author: Marco Martin <notmart@gmail.com>
This patch makes children items of an hidden qgraphicsitem not be shown if show() is called on them. fixes several issues like the opensocial plasma widget and the Plasma desktop toolbox behaviour.
Index: src/gui/graphicsview/qgraphicsitem.cpp
===================================================================
--- src/gui/graphicsview/qgraphicsitem.cpp (revision 958522)
+++ src/gui/graphicsview/qgraphicsitem.cpp (working copy)
@@ -1522,6 +1522,11 @@
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)));