From 8102b75ee85a4cf0c2af2eea3787ff0209e01998 Mon Sep 17 00:00:00 2001 From: Sergio Ahumada Date: Tue, 18 Feb 2014 09:22:11 +0100 Subject: [PATCH] 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 --- .../dialogs/qfilesystemmodel/tst_qfilesystemmodel.cpp | 6 ++++-- tests/auto/widgets/itemviews/qtableview/tst_qtableview.cpp | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/tests/auto/widgets/dialogs/qfilesystemmodel/tst_qfilesystemmodel.cpp b/tests/auto/widgets/dialogs/qfilesystemmodel/tst_qfilesystemmodel.cpp index 9cb391d5f46..eac3f9c9aec 100644 --- a/tests/auto/widgets/dialogs/qfilesystemmodel/tst_qfilesystemmodel.cpp +++ b/tests/auto/widgets/dialogs/qfilesystemmodel/tst_qfilesystemmodel.cpp @@ -57,6 +57,8 @@ # include // for SetFileAttributes #endif +#include + #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 diff --git a/tests/auto/widgets/itemviews/qtableview/tst_qtableview.cpp b/tests/auto/widgets/itemviews/qtableview/tst_qtableview.cpp index dfb780c8fa9..4afe80b0875 100644 --- a/tests/auto/widgets/itemviews/qtableview/tst_qtableview.cpp +++ b/tests/auto/widgets/itemviews/qtableview/tst_qtableview.cpp @@ -46,6 +46,8 @@ #include #include "private/qapplication_p.h" +#include + #ifdef QT_BUILD_INTERNAL #define VERIFY_SPANS_CONSISTENCY(TEST_VIEW_) \ QVERIFY(static_cast(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()); + std::sort(sortedDataA.begin(), sortedDataA.end()); + std::sort(sortedDataD.begin(), sortedDataD.end(), qGreater()); model.setStringList(data); QTableView view; view.setModel(&model);