summaryrefslogtreecommitdiffstats
path: root/src/gui/graphicsview/qgraphicsscenebsptreeindex.cpp
diff options
context:
space:
mode:
authorBjørn Erik Nilsen <bjorn.nilsen@nokia.com>2009-06-30 14:15:28 (GMT)
committerBjørn Erik Nilsen <bjorn.nilsen@nokia.com>2009-06-30 14:15:28 (GMT)
commit3a00930fe167e6db5588d9e93d429486f9591bd1 (patch)
tree2da7686fabb538876c783a816042e633a323a491 /src/gui/graphicsview/qgraphicsscenebsptreeindex.cpp
parent99bea47fd9b868fb22f175943c11ecb05b51f07c (diff)
downloadQt-3a00930fe167e6db5588d9e93d429486f9591bd1.zip
Qt-3a00930fe167e6db5588d9e93d429486f9591bd1.tar.gz
Qt-3a00930fe167e6db5588d9e93d429486f9591bd1.tar.bz2
More BSP tree index cleanup.
Ensure the index of indexed items are reset to -1. Makes tst_QGraphicsScene::itemIndexMethod happy. (this test passed before we actually started using the BSP from the items() functions, see 6ee3fb750377eeedf161d96fef02c5fa336810e9)
Diffstat (limited to 'src/gui/graphicsview/qgraphicsscenebsptreeindex.cpp')
-rw-r--r--src/gui/graphicsview/qgraphicsscenebsptreeindex.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/gui/graphicsview/qgraphicsscenebsptreeindex.cpp b/src/gui/graphicsview/qgraphicsscenebsptreeindex.cpp
index 413c8de..ff9a3da 100644
--- a/src/gui/graphicsview/qgraphicsscenebsptreeindex.cpp
+++ b/src/gui/graphicsview/qgraphicsscenebsptreeindex.cpp
@@ -468,6 +468,18 @@ QGraphicsSceneBspTreeIndex::QGraphicsSceneBspTreeIndex(QGraphicsScene *scene)
}
+QGraphicsSceneBspTreeIndex::~QGraphicsSceneBspTreeIndex()
+{
+ Q_D(QGraphicsSceneBspTreeIndex);
+ for (int i = 0; i < d->indexedItems.size(); ++i) {
+ // Ensure item bits are reset properly.
+ if (QGraphicsItem *item = d->indexedItems.at(i)) {
+ Q_ASSERT(!item->d_ptr->itemDiscovered);
+ item->d_ptr->index = -1;
+ }
+ }
+}
+
/*!
\reimp
Clear the all the BSP index.