aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qquickxmllistmodel
diff options
context:
space:
mode:
authorGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2013-09-12 11:06:59 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-09-13 01:10:37 +0200
commit4df73e62a70b73d955ab53faef4615ea03a21a4d (patch)
tree00acf9163a0447da03298659bc47d2de9da509f7 /tests/auto/quick/qquickxmllistmodel
parentc1821de0e6ef21f86623572fd54f5cc5451b6077 (diff)
Remove qSort usages from declarative
QtAlgorithms is getting deprecated, see http://www.mail-archive.com/development@qt-project.org/msg01603.html Change-Id: I8fa7d0186cc8f0ba562695974829e37f1eb87f2f Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'tests/auto/quick/qquickxmllistmodel')
-rw-r--r--tests/auto/quick/qquickxmllistmodel/tst_qquickxmllistmodel.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/tests/auto/quick/qquickxmllistmodel/tst_qquickxmllistmodel.cpp b/tests/auto/quick/qquickxmllistmodel/tst_qquickxmllistmodel.cpp
index 1f7a8029dc..12ae3c273f 100644
--- a/tests/auto/quick/qquickxmllistmodel/tst_qquickxmllistmodel.cpp
+++ b/tests/auto/quick/qquickxmllistmodel/tst_qquickxmllistmodel.cpp
@@ -58,6 +58,8 @@
#include <QtQml/qqmlcomponent.h>
#include "../../../../src/imports/xmllistmodel/qqmlxmllistmodel_p.h"
+#include <algorithm>
+
typedef QPair<int, int> QQuickXmlListRange;
typedef QList<QVariantList> QQmlXmlModelData;
@@ -608,7 +610,7 @@ void tst_qquickxmllistmodel::useKeys()
}
QList<int> roles = model->roleNames().keys();
- qSort(roles);
+ std::sort(roles.begin(), roles.end());
for (int i=0; i<model->rowCount(); i++) {
QModelIndex index = model->index(i, 0);
for (int j=0; j<roles.count(); j++)
@@ -759,7 +761,7 @@ void tst_qquickxmllistmodel::noKeysValueChanges()
model->setProperty("xml",xml);
QList<int> roles = model->roleNames().keys();
- qSort(roles);
+ std::sort(roles.begin(), roles.end());
// wait for the new xml data to be set, and verify no signals were emitted
QTRY_VERIFY(model->data(model->index(0, 0), roles.at(2)).toString() != QLatin1String("Football"));
QCOMPARE(model->data(model->index(0, 0), roles.at(2)).toString(), QLatin1String("AussieRules"));
@@ -860,21 +862,21 @@ void tst_qquickxmllistmodel::threading()
for (int i=0; i<dataCount; i++) {
QModelIndex index = m1->index(i, 0);
QList<int> roles = m1->roleNames().keys();
- qSort(roles);
+ std::sort(roles.begin(), roles.end());
QCOMPARE(m1->data(index, roles.at(0)).toString(), QString("A" + QString::number(i)));
QCOMPARE(m1->data(index, roles.at(1)).toString(), QString("1" + QString::number(i)));
QCOMPARE(m1->data(index, roles.at(2)).toString(), QString("Football"));
index = m2->index(i, 0);
roles = m2->roleNames().keys();
- qSort(roles);
+ std::sort(roles.begin(), roles.end());
QCOMPARE(m2->data(index, roles.at(0)).toString(), QString("B" + QString::number(i)));
QCOMPARE(m2->data(index, roles.at(1)).toString(), QString("2" + QString::number(i)));
QCOMPARE(m2->data(index, roles.at(2)).toString(), QString("Athletics"));
index = m3->index(i, 0);
roles = m3->roleNames().keys();
- qSort(roles);
+ std::sort(roles.begin(), roles.end());
QCOMPARE(m3->data(index, roles.at(0)).toString(), QString("C" + QString::number(i)));
QCOMPARE(m3->data(index, roles.at(1)).toString(), QString("3" + QString::number(i)));
QCOMPARE(m3->data(index, roles.at(2)).toString(), QString("Curling"));