Create an invalid QPersistentModelIndex if it will be converted anyway.
authorStephen Kelly <stephen.kelly@kdab.com>
Thu, 27 Sep 2012 15:58:01 +0000 (17:58 +0200)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Thu, 27 Sep 2012 16:35:55 +0000 (18:35 +0200)
Change-Id: I278d4515d74e2213492c443e5a04731b2e79fe1e
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
src/corelib/itemmodels/qsortfilterproxymodel.cpp

index a0120d0..042c6ce 100644 (file)
@@ -1301,7 +1301,7 @@ void QSortFilterProxyModelPrivate::_q_sourceLayoutAboutToBeChanged(const QList<Q
     QList<QPersistentModelIndex> parents;
     foreach (const QPersistentModelIndex &parent, sourceParents) {
         if (!parent.isValid()) {
-            parents << QModelIndex();
+            parents << QPersistentModelIndex();
             continue;
         }
         const QModelIndex mappedParent = q->mapFromSource(parent);
@@ -1342,7 +1342,7 @@ void QSortFilterProxyModelPrivate::_q_sourceLayoutChanged(const QList<QPersisten
     QList<QPersistentModelIndex> parents;
     foreach (const QPersistentModelIndex &parent, sourceParents) {
         if (!parent.isValid()) {
-            parents << QModelIndex();
+            parents << QPersistentModelIndex();
             continue;
         }
         const QModelIndex mappedParent = q->mapFromSource(parent);