From 1c0599289a3da43b0a7cdb38eebe05d45f69ad9c Mon Sep 17 00:00:00 2001 From: Andreas Aardal Hanssen Date: Fri, 5 Jun 2009 10:11:05 +0200 Subject: Fix tst_QGraphicsView::cursor2() - sorting bug when using BSP tree. Make sure we don't claim that we have sorted all toplevel items when we are using the BSP tree, as when painting we have only actually sorted a subset of the elements. --- src/gui/graphicsview/qgraphicsscene.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/graphicsview/qgraphicsscene.cpp b/src/gui/graphicsview/qgraphicsscene.cpp index 4b54c08..6c78ca9 100644 --- a/src/gui/graphicsview/qgraphicsscene.cpp +++ b/src/gui/graphicsview/qgraphicsscene.cpp @@ -5217,11 +5217,11 @@ void QGraphicsScenePrivate::drawSubtreeRecursive(QGraphicsItem *item, QPainter * if (item && item->d_ptr->needSortChildren) { item->d_ptr->needSortChildren = 0; qStableSort(children->begin(), children->end(), qt_notclosestLeaf); + } else if (!item && children == &tmp) { + qStableSort(children->begin(), children->end(), qt_notclosestLeaf); } else if (!item && needSortTopLevelItems) { needSortTopLevelItems = false; qStableSort(children->begin(), children->end(), qt_notclosestLeaf); - } else if (!item && children == &tmp) { - qStableSort(children->begin(), children->end(), qt_notclosestLeaf); } } -- cgit v0.12