diff options
author | Jan-Arve Sæther <jan-arve.saether@nokia.com> | 2009-04-02 13:58:33 (GMT) |
---|---|---|
committer | Jan-Arve Sæther <jan-arve.saether@nokia.com> | 2009-04-02 13:58:33 (GMT) |
commit | ceb253c234f840f7aeec10fa4450e840c6b242f4 (patch) | |
tree | fff9581e26361f0cc8aa0d0590044ed33133d6e7 /src | |
parent | f399569248c6bdc9cb828471fe6bcc66b90c4535 (diff) | |
download | Qt-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.cpp | 17 |
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) { |