summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/gui/graphicsview/qgraphicsscene.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/gui/graphicsview/qgraphicsscene.cpp b/src/gui/graphicsview/qgraphicsscene.cpp
index faacf4d..ed1d2f3 100644
--- a/src/gui/graphicsview/qgraphicsscene.cpp
+++ b/src/gui/graphicsview/qgraphicsscene.cpp
@@ -1087,11 +1087,8 @@ QList<QGraphicsItem *> QGraphicsScenePrivate::topLevelItemsInStackingOrder(const
QList<QGraphicsItem *> tmp = index->estimateItems(sceneRect, Qt::SortOrder(-1),
viewTransform ? *viewTransform : QTransform());
- for (int i = 0; i < tmp.size(); ++i) {
- QGraphicsItem *item = tmp.at(i);
- if (!item->d_ptr->parent)
- item->d_ptr->itemDiscovered = 1;
- }
+ for (int i = 0; i < tmp.size(); ++i)
+ tmp.at(i)->topLevelItem()->d_ptr->itemDiscovered = 1;
// Sort if the toplevel list is unsorted.
if (needSortTopLevelItems) {