Emit layout change hint from QStringListModel.
authorStephen Kelly <stephen.kelly@kdab.com>
Thu, 27 Sep 2012 09:12:59 +0000 (11:12 +0200)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Sun, 30 Sep 2012 16:29:59 +0000 (18:29 +0200)
Change-Id: I8b4a01cfcca59103f2616b72645994a22bff40dd
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
src/corelib/itemmodels/qstringlistmodel.cpp

index 897a4ad..2bea97d 100644 (file)
@@ -249,7 +249,7 @@ static bool decendingLessThan(const QPair<QString, int> &s1, const QPair<QString
 */
 void QStringListModel::sort(int, Qt::SortOrder order)
 {
-    emit layoutAboutToBeChanged();
+    emit layoutAboutToBeChanged(QList<QPersistentModelIndex>(), VerticalSortHint);
 
     QList<QPair<QString, int> > list;
     for (int i = 0; i < lst.count(); ++i)
@@ -273,7 +273,7 @@ void QStringListModel::sort(int, Qt::SortOrder order)
         newList.append(index(forwarding.at(oldList.at(i).row()), 0));
     changePersistentIndexList(oldList, newList);
 
-    emit layoutChanged();
+    emit layoutChanged(QList<QPersistentModelIndex>(), VerticalSortHint);
 }
 
 /*!