From f30f58edc31fec0b992cb291e5c959563341176a Mon Sep 17 00:00:00 2001 From: Giuseppe D'Angelo Date: Thu, 1 Nov 2012 23:07:56 +0100 Subject: Remove qSort usages from QStringList QtAlgorithms is getting deprecated, see http://www.mail-archive.com/development@qt-project.org/msg01603.html Change-Id: I38d220142d4f5e580503cc10f804e0d16f418cc1 Reviewed-by: Olivier Goffart --- src/corelib/tools/qstringlist.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/corelib/tools/qstringlist.cpp') diff --git a/src/corelib/tools/qstringlist.cpp b/src/corelib/tools/qstringlist.cpp index a5559a181b..870ac23028 100644 --- a/src/corelib/tools/qstringlist.cpp +++ b/src/corelib/tools/qstringlist.cpp @@ -43,6 +43,8 @@ #include #include +#include + QT_BEGIN_NAMESPACE /*! \typedef QStringListIterator @@ -222,8 +224,8 @@ QT_BEGIN_NAMESPACE If \a cs is \l Qt::CaseSensitive (the default), the string comparison is case sensitive; otherwise the comparison is case insensitive. - Sorting is performed using Qt's qSort() algorithm, - which operates in \l{linear-logarithmic time}, i.e. O(\e{n} log \e{n}). + Sorting is performed using the STL's std::sort() algorithm, + which averages \l{linear-logarithmic time}, i.e. O(\e{n} log \e{n}). If you want to sort your strings in an arbitrary order, consider using the QMap class. For example, you could use a QMap to sort the strings by some integer index. - - \sa qSort() */ static inline bool caseInsensitiveLessThan(const QString &s1, const QString &s2) @@ -243,9 +243,9 @@ static inline bool caseInsensitiveLessThan(const QString &s1, const QString &s2) void QtPrivate::QStringList_sort(QStringList *that, Qt::CaseSensitivity cs) { if (cs == Qt::CaseSensitive) - qSort(that->begin(), that->end()); + std::sort(that->begin(), that->end()); else - qSort(that->begin(), that->end(), caseInsensitiveLessThan); + std::sort(that->begin(), that->end(), caseInsensitiveLessThan); } -- cgit v1.2.3