1 commit 705880f0045ac39140f980d69aec68869213e379
2 Author: Alexis Menard <alexis.menard@nokia.com>
3 Date: Thu Nov 26 13:47:34 2009 +0100
5 Fix a crash in KDE/Plasma with QGraphicsView. TopLevel list of items
8 This nasty bug was triggered when the index sort the top level list of
9 items. We forgot to set the flag topLevelSequentialOrdering to false
10 so when an item was removed from the top level list it was using the
11 sibling index which can be not valid anymore since the list is not
12 sorted by sequential order. So it let some dangling pointers in the
13 list which make processDirtyItemRecursive crash the next paint event.
18 diff --git a/src/gui/graphicsview/qgraphicsscene_p.h b/src/gui/graphicsview/qgraphicsscene_p.h
19 index a1d0496..69e4d5b 100644
20 --- a/src/gui/graphicsview/qgraphicsscene_p.h
21 +++ b/src/gui/graphicsview/qgraphicsscene_p.h
22 @@ -78,7 +78,7 @@ class QGraphicsSceneIndex;
24 class QGraphicsWidget;
26 -class QGraphicsScenePrivate : public QObjectPrivate
27 +class Q_AUTOTEST_EXPORT QGraphicsScenePrivate : public QObjectPrivate
29 Q_DECLARE_PUBLIC(QGraphicsScene)
31 @@ -265,6 +265,7 @@ public:
33 if (needSortTopLevelItems) {
34 qSort(topLevelItems.begin(), topLevelItems.end(), qt_notclosestLeaf);
35 + topLevelSequentialOrdering = false;
36 needSortTopLevelItems = false;