aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qml/qqmlecmascript/testtypes.h4
-rw-r--r--tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp10
2 files changed, 7 insertions, 7 deletions
diff --git a/tests/auto/qml/qqmlecmascript/testtypes.h b/tests/auto/qml/qqmlecmascript/testtypes.h
index da2a9ba130..dead289b15 100644
--- a/tests/auto/qml/qqmlecmascript/testtypes.h
+++ b/tests/auto/qml/qqmlecmascript/testtypes.h
@@ -1744,8 +1744,8 @@ public:
QString funcCalled;
public slots:
QPersistentModelIndex getIndex() const { return QPersistentModelIndex(QModelIndex()); }
- void selection(const QModelIndex &mi, int n = 0) { funcCalled = QLatin1String("QModelIndex"); }
- void selection(const QItemSelection &is, int n = 0) { funcCalled = QLatin1String("QItemSelection"); }
+ void selection(const QModelIndex &, int = 0) { funcCalled = QLatin1String("QModelIndex"); }
+ void selection(const QItemSelection &, int = 0) { funcCalled = QLatin1String("QItemSelection"); }
};
struct ClassWithQProperty2 : public QObject
diff --git a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
index dd662ef6d3..8778a1e1ac 100644
--- a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
+++ b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
@@ -4205,9 +4205,8 @@ void tst_qqmlecmascript::singletonType()
if (!errorMessage.isEmpty())
QTest::ignoreMessage(QtWarningMsg, errorMessage.toLatin1().constData());
- if (warningMessages.size())
- foreach (const QString &warning, warningMessages)
- QTest::ignoreMessage(QtWarningMsg, warning.toLatin1().constData());
+ for (const QString &warning : qAsConst(warningMessages))
+ QTest::ignoreMessage(QtWarningMsg, warning.toLatin1().constData());
QObject *object = component.create();
if (!errorMessage.isEmpty()) {
@@ -4566,9 +4565,10 @@ void tst_qqmlecmascript::importScripts()
if (!errorMessage.isEmpty())
QTest::ignoreMessage(QtWarningMsg, errorMessage.toLatin1().constData());
- if (compilationShouldSucceed && warningMessages.size())
- foreach (const QString &warning, warningMessages)
+ if (compilationShouldSucceed) {
+ for (const QString &warning : qAsConst(warningMessages))
QTest::ignoreMessage(QtWarningMsg, warning.toLatin1().constData());
+ }
if (compilationShouldSucceed)
QTRY_VERIFY(component.isReady());