summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJan-Arve Sæther <jan-arve.saether@nokia.com>2009-04-02 13:58:33 (GMT)
committerJan-Arve Sæther <jan-arve.saether@nokia.com>2009-04-02 13:58:33 (GMT)
commitceb253c234f840f7aeec10fa4450e840c6b242f4 (patch)
treefff9581e26361f0cc8aa0d0590044ed33133d6e7 /src
parentf399569248c6bdc9cb828471fe6bcc66b90c4535 (diff)
downloadQt-ceb253c234f840f7aeec10fa4450e840c6b242f4.zip
Qt-ceb253c234f840f7aeec10fa4450e840c6b242f4.tar.gz
Qt-ceb253c234f840f7aeec10fa4450e840c6b242f4.tar.bz2
Don't need to update visibility and enabled if the item is destructing
This actually caused a crash, since we would call the pure virtual boundingRect() function in setVisibleHelper(). (The 'update' argument was set to true.) Reviewed-by: andreas
Diffstat (limited to 'src')
-rw-r--r--src/gui/graphicsview/qgraphicsitem.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp
index 11a37f5..c5f5889 100644
--- a/src/gui/graphicsview/qgraphicsitem.cpp
+++ b/src/gui/graphicsview/qgraphicsitem.cpp
@@ -854,15 +854,16 @@ void QGraphicsItemPrivate::setParentItemHelper(QGraphicsItem *newParent, bool de
updateAncestorFlag(QGraphicsItem::ItemClipsChildrenToShape);
updateAncestorFlag(QGraphicsItem::ItemIgnoresTransformations);
- // Update item visible / enabled.
- if (!visible && !explicitlyHidden)
- setVisibleHelper(true, /* explicit = */ false);
- if (!enabled && !explicitlyDisabled)
- setEnabledHelper(true, /* explicit = */ false);
-
- // If the item is being deleted, the whole scene will be updated.
- if (!deleting)
+ if (!deleting) {
+ // Update item visible / enabled.
+ if (!visible && !explicitlyHidden)
+ setVisibleHelper(true, /* explicit = */ false);
+ if (!enabled && !explicitlyDisabled)
+ setEnabledHelper(true, /* explicit = */ false);
+
+ // If the item is being deleted, the whole scene will be updated.
updateHelper();
+ }
}
if (scene) {