diff options
author | Andreas Aardal Hanssen <andreas.aardal.hanssen@nokia.com> | 2009-06-23 14:57:32 (GMT) |
---|---|---|
committer | Andreas Aardal Hanssen <andreas.aardal.hanssen@nokia.com> | 2009-06-23 14:58:46 (GMT) |
commit | b0f391ae8f2efc272be852f951403fa8e4a8f561 (patch) | |
tree | 6b7ce26daf6a79f36e647d785900ddfc599b836d /src/gui/graphicsview/qgraphicsscenebsptreeindex.cpp | |
parent | d39a62720ba67a0fa6e4e37519d22f14c7b7404e (diff) | |
download | Qt-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.cpp | 3 |
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(); } |