summaryrefslogtreecommitdiffstats
path: root/src/corelib/itemmodels/qitemselectionmodel.cpp
diff options
context:
space:
mode:
authorGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2012-11-01 23:35:03 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2012-11-07 21:26:08 +0100
commita454ccb89ec2296234ee7328095f27ad7cb2361f (patch)
treecf141ec01b720ea0d0419d594d8da7d58f89706f /src/corelib/itemmodels/qitemselectionmodel.cpp
parent0d2997862bd46526d14bb5b8114215d8416bc751 (diff)
Remove qSort/qStableSort usages from itemmodels
Change-Id: I53c650f170fc8a6142373c1e7da0f4876188a39e Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Diffstat (limited to 'src/corelib/itemmodels/qitemselectionmodel.cpp')
-rw-r--r--src/corelib/itemmodels/qitemselectionmodel.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/corelib/itemmodels/qitemselectionmodel.cpp b/src/corelib/itemmodels/qitemselectionmodel.cpp
index d1cbd7f461..e05b76f5da 100644
--- a/src/corelib/itemmodels/qitemselectionmodel.cpp
+++ b/src/corelib/itemmodels/qitemselectionmodel.cpp
@@ -43,6 +43,8 @@
#include <private/qitemselectionmodel_p.h>
#include <qdebug.h>
+#include <algorithm>
+
#ifndef QT_NO_ITEMVIEWS
QT_BEGIN_NAMESPACE
@@ -1007,8 +1009,8 @@ void QItemSelectionModelPrivate::_q_layoutChanged(const QList<QPersistentModelIn
if (hint != QAbstractItemModel::VerticalSortHint) {
// sort the "new" selection, as preparation for merging
- qStableSort(savedPersistentIndexes.begin(), savedPersistentIndexes.end());
- qStableSort(savedPersistentCurrentIndexes.begin(), savedPersistentCurrentIndexes.end());
+ std::stable_sort(savedPersistentIndexes.begin(), savedPersistentIndexes.end());
+ std::stable_sort(savedPersistentCurrentIndexes.begin(), savedPersistentCurrentIndexes.end());
// update the selection by merging the individual indexes
ranges = mergeIndexes(savedPersistentIndexes);
@@ -1019,8 +1021,8 @@ void QItemSelectionModelPrivate::_q_layoutChanged(const QList<QPersistentModelIn
savedPersistentCurrentIndexes.clear();
} else {
// sort the "new" selection, as preparation for merging
- qStableSort(savedPersistentRowLengths.begin(), savedPersistentRowLengths.end());
- qStableSort(savedPersistentCurrentRowLengths.begin(), savedPersistentCurrentRowLengths.end());
+ std::stable_sort(savedPersistentRowLengths.begin(), savedPersistentRowLengths.end());
+ std::stable_sort(savedPersistentCurrentRowLengths.begin(), savedPersistentCurrentRowLengths.end());
// update the selection by merging the individual indexes
ranges = mergeRowLengths(savedPersistentRowLengths);