diff options
author | Bjørn Erik Nilsen <bjorn.nilsen@nokia.com> | 2009-06-29 13:44:11 (GMT) |
---|---|---|
committer | Bjørn Erik Nilsen <bjorn.nilsen@nokia.com> | 2009-06-29 13:57:11 (GMT) |
commit | 4dcb46a3796fbd9baf1ba6dcddcc9944e69e3153 (patch) | |
tree | 901c5591c4b97e19a29732be541595d742cafe6d /src/gui/graphicsview/qgraphicsscenebsptreeindex.cpp | |
parent | 7fe4f8ff71cf09bbabbd3438ef637fe408a11c33 (diff) | |
download | Qt-4dcb46a3796fbd9baf1ba6dcddcc9944e69e3153.zip Qt-4dcb46a3796fbd9baf1ba6dcddcc9944e69e3153.tar.gz Qt-4dcb46a3796fbd9baf1ba6dcddcc9944e69e3153.tar.bz2 |
Add lacking parenthesis around bitwise AND operator.
This caused a crash in the diagramscene example because "!bits & something"
does not have the same meaning as "!(bits & something)", hence item was
never removed from the BSP resulting in a stale item pointer.
Diffstat (limited to 'src/gui/graphicsview/qgraphicsscenebsptreeindex.cpp')
-rw-r--r-- | src/gui/graphicsview/qgraphicsscenebsptreeindex.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gui/graphicsview/qgraphicsscenebsptreeindex.cpp b/src/gui/graphicsview/qgraphicsscenebsptreeindex.cpp index 44a0082..413c8de 100644 --- a/src/gui/graphicsview/qgraphicsscenebsptreeindex.cpp +++ b/src/gui/graphicsview/qgraphicsscenebsptreeindex.cpp @@ -350,7 +350,7 @@ void QGraphicsSceneBspTreeIndexPrivate::removeItem(QGraphicsItem *item, bool rec // Avoid virtual function calls from the destructor. purgePending = true; removedItems << item; - } else if (!item->d_ptr->ancestorFlags & QGraphicsItemPrivate::AncestorClipsChildren) { + } else if (!(item->d_ptr->ancestorFlags & QGraphicsItemPrivate::AncestorClipsChildren)) { bsp.removeItem(item, item->sceneBoundingRect()); } } else { @@ -518,7 +518,7 @@ void QGraphicsSceneBspTreeIndex::prepareBoundingRectChange(const QGraphicsItem * return; if (item->d_ptr->index == -1 || item->d_ptr->itemIsUntransformable() - || item->d_func()->ancestorFlags & QGraphicsItemPrivate::AncestorClipsChildren) { + || (item->d_ptr->ancestorFlags & QGraphicsItemPrivate::AncestorClipsChildren)) { return; // Item is not in BSP tree; nothing to do. } |