Remove qSort usages from widgets tests

QtAlgorithms is getting deprecated,
see http://www.mail-archive.com/development@qt-project.org/msg01603.html

Change-Id: Ica7639d16f52b4ffcd2c00cc806fed1378a7948b
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
This commit is contained in:
Sergio Ahumada 2014-02-18 09:22:11 +01:00 committed by The Qt Project
parent 21fbca97a8
commit 8102b75ee8
2 changed files with 8 additions and 4 deletions

View File

@ -57,6 +57,8 @@
# include <qt_windows.h> // for SetFileAttributes
#endif
#include <algorithm>
#define WAITTIME 1000
// Will try to wait for the condition while allowing event processing
@ -710,8 +712,8 @@ void tst_QFileSystemModel::filters()
for (int i = 0; i < rowCount; ++i)
modelEntries.append(model->data(model->index(i, 0, root), QFileSystemModel::FileNameRole).toString());
qSort(dirEntries);
qSort(modelEntries);
std::sort(dirEntries.begin(), dirEntries.end());
std::sort(modelEntries.begin(), modelEntries.end());
QCOMPARE(dirEntries, modelEntries);
#ifdef Q_OS_LINUX

View File

@ -46,6 +46,8 @@
#include <QtTest/QtTest>
#include "private/qapplication_p.h"
#include <algorithm>
#ifdef QT_BUILD_INTERNAL
#define VERIFY_SPANS_CONSISTENCY(TEST_VIEW_) \
QVERIFY(static_cast<QTableViewPrivate*>(QObjectPrivate::get(TEST_VIEW_))->spans.checkConsistency())
@ -3921,8 +3923,8 @@ void tst_QTableView::task234926_setHeaderSorting()
data << "orange" << "apple" << "banana" << "lemon" << "pumpkin";
QStringList sortedDataA = data;
QStringList sortedDataD = data;
qSort(sortedDataA);
qSort(sortedDataD.begin(), sortedDataD.end(), qGreater<QString>());
std::sort(sortedDataA.begin(), sortedDataA.end());
std::sort(sortedDataD.begin(), sortedDataD.end(), qGreater<QString>());
model.setStringList(data);
QTableView view;
view.setModel(&model);