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:
parent
21fbca97a8
commit
8102b75ee8
@ -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
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user