summaryrefslogtreecommitdiffstats
path: root/src/gui/graphicsview/qgraphicssceneindex.cpp
diff options
context:
space:
mode:
authorBjørn Erik Nilsen <bjorn.nilsen@nokia.com>2009-07-02 14:59:51 +0200
committerBjørn Erik Nilsen <bjorn.nilsen@nokia.com>2009-07-02 14:59:51 +0200
commitc4ae87721e011fe44f301c4039f0651a05394162 (patch)
treec5e35a6360a7b93463ae627a8781a3b0ad138499 /src/gui/graphicsview/qgraphicssceneindex.cpp
parent6d71de4283c05b1b42ef26fe4c23334ad34c8a54 (diff)
Speedup item-lookup in Graphics View.
We don't have to do a stable sort anymore because the lessThan operator now accounts for the insertion order. This also means we don't have to sort all top-level items to preserve the insertion order in QGraphicsScenePrivate::topLevelItemsInStackingOrder. Reviewed-by: Andreas
Diffstat (limited to 'src/gui/graphicsview/qgraphicssceneindex.cpp')
-rw-r--r--src/gui/graphicsview/qgraphicssceneindex.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/gui/graphicsview/qgraphicssceneindex.cpp b/src/gui/graphicsview/qgraphicssceneindex.cpp
index b317e8e04d..d6281e2558 100644
--- a/src/gui/graphicsview/qgraphicssceneindex.cpp
+++ b/src/gui/graphicsview/qgraphicssceneindex.cpp
@@ -266,10 +266,7 @@ void QGraphicsSceneIndexPrivate::recursive_items_helper(QGraphicsItem *item, QRe
int i = 0;
if (itemHasChildren) {
// Sort children.
- if (item->d_ptr->needSortChildren) {
- item->d_ptr->needSortChildren = 0;
- qStableSort(item->d_ptr->children.begin(), item->d_ptr->children.end(), qt_notclosestLeaf);
- }
+ item->d_ptr->ensureSortedChildren();
// Clip to shape.
if (itemClipsChildrenToShape)