summaryrefslogtreecommitdiffstats
path: root/src/gui/graphicsview/qgraphicsscenebsptreeindex.cpp
diff options
context:
space:
mode:
authorAndreas Aardal Hanssen <andreas.aardal.hanssen@nokia.com>2009-06-23 14:57:32 (GMT)
committerAndreas Aardal Hanssen <andreas.aardal.hanssen@nokia.com>2009-06-23 14:58:46 (GMT)
commitb0f391ae8f2efc272be852f951403fa8e4a8f561 (patch)
tree6b7ce26daf6a79f36e647d785900ddfc599b836d /src/gui/graphicsview/qgraphicsscenebsptreeindex.cpp
parentd39a62720ba67a0fa6e4e37519d22f14c7b7404e (diff)
downloadQt-b0f391ae8f2efc272be852f951403fa8e4a8f561.zip
Qt-b0f391ae8f2efc272be852f951403fa8e4a8f561.tar.gz
Qt-b0f391ae8f2efc272be852f951403fa8e4a8f561.tar.bz2
Fix tst_QGraphicsItem::collidesWith_item autotest.
Avoid unwanted recursion by keeping the sceneRect variable locally. The recursion happens if the call to sceneRect() lazily emits the sceneRectChanged() signal.
Diffstat (limited to 'src/gui/graphicsview/qgraphicsscenebsptreeindex.cpp')
-rw-r--r--src/gui/graphicsview/qgraphicsscenebsptreeindex.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gui/graphicsview/qgraphicsscenebsptreeindex.cpp b/src/gui/graphicsview/qgraphicsscenebsptreeindex.cpp
index 464fe8e..8861c7b 100644
--- a/src/gui/graphicsview/qgraphicsscenebsptreeindex.cpp
+++ b/src/gui/graphicsview/qgraphicsscenebsptreeindex.cpp
@@ -157,7 +157,7 @@ void QGraphicsSceneBspTreeIndexPrivate::_q_updateIndex()
// Regenerate the tree.
if (regenerateIndex) {
regenerateIndex = false;
- bsp.initialize(q->scene()->sceneRect(), bspTreeDepth);
+ bsp.initialize(sceneRect, bspTreeDepth);
unindexedItems = indexedItems;
lastItemCount = indexedItems.size();
}
@@ -689,6 +689,7 @@ void QGraphicsSceneBspTreeIndex::setBspTreeDepth(int depth)
void QGraphicsSceneBspTreeIndex::sceneRectChanged()
{
Q_D(QGraphicsSceneBspTreeIndex);
+ d->sceneRect = d->scene->sceneRect();
d->resetIndex();
}