aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@qt.io>2022-10-08 19:56:03 +0200
committerMarc Mutz <marc.mutz@qt.io>2022-10-13 00:18:35 +0200
commit5eb52b725526c26d0efa3856b6aba1919010f8fd (patch)
tree64d1bde7a2cc624e586228c9768c7eb1ea360e6c /tests
parente1a0596924766d62459740ed0271114a7bb99851 (diff)
Port from container::count() and length() to size() - V5
This is a semantic patch using ClangTidyTransformator as in qtbase/df9d882d41b741fef7c5beeddb0abe9d904443d8, but extended to handle typedefs and accesses through pointers, too: const std::string o = "object"; auto hasTypeIgnoringPointer = [](auto type) { return anyOf(hasType(type), hasType(pointsTo(type))); }; auto derivedFromAnyOfClasses = [&](ArrayRef<StringRef> classes) { auto exprOfDeclaredType = [&](auto decl) { return expr(hasTypeIgnoringPointer(hasUnqualifiedDesugaredType(recordType(hasDeclaration(decl))))).bind(o); }; return exprOfDeclaredType(cxxRecordDecl(isSameOrDerivedFrom(hasAnyName(classes)))); }; auto renameMethod = [&] (ArrayRef<StringRef> classes, StringRef from, StringRef to) { return makeRule(cxxMemberCallExpr(on(derivedFromAnyOfClasses(classes)), callee(cxxMethodDecl(hasName(from), parameterCountIs(0)))), changeTo(cat(access(o, cat(to)), "()")), cat("use '", to, "' instead of '", from, "'")); }; renameMethod(<classes>, "count", "size"); renameMethod(<classes>, "length", "size"); except that on() was replaced with a matcher that doesn't ignoreParens(). a.k.a qt-port-to-std-compatible-api V5 with config Scope: 'Container'. Change-Id: I58e1b41b91c34d2e860dbb5847b3752edbfc6fc9 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qml/animation/qsequentialanimationgroupjob/tst_qsequentialanimationgroupjob.cpp10
-rw-r--r--tests/auto/qml/debugger/qqmlenginedebugservice/tst_qqmlenginedebugservice.cpp2
-rw-r--r--tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp6
-rw-r--r--tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp8
-rw-r--r--tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp164
-rw-r--r--tests/auto/qml/qqmlengine/tst_qqmlengine.cpp2
-rw-r--r--tests/auto/qml/qqmlitemmodels/tst_qqmlitemmodels.cpp4
-rw-r--r--tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp18
-rw-r--r--tests/auto/qml/qqmllistmodel/tst_qqmllistmodel.cpp4
-rw-r--r--tests/auto/qml/qqmllistmodelworkerscript/tst_qqmllistmodelworkerscript.cpp8
-rw-r--r--tests/auto/qml/qqmllistreference/tst_qqmllistreference.cpp2
-rw-r--r--tests/auto/qml/qqmlobjectmodel/tst_qqmlobjectmodel.cpp2
-rw-r--r--tests/auto/qml/qqmlproperty/tst_qqmlproperty.cpp4
-rw-r--r--tests/auto/qml/qqmlsqldatabase/tst_qqmlsqldatabase.cpp4
-rw-r--r--tests/auto/qml/qqmlxmllistmodel/tst_qqmlxmllistmodel.cpp4
-rw-r--r--tests/auto/quick/pointerhandlers/qquickpointhandler/tst_qquickpointhandler.cpp18
-rw-r--r--tests/auto/quick/qquickaccessible/tst_qquickaccessible.cpp4
-rw-r--r--tests/auto/quick/qquickgridview/tst_qquickgridview.cpp26
-rw-r--r--tests/auto/quick/qquicklistview/tst_qquicklistview.cpp26
-rw-r--r--tests/auto/quick/qquicklistview2/tst_qquicklistview2.cpp2
-rw-r--r--tests/auto/quick/qquickloader/tst_qquickloader.cpp2
-rw-r--r--tests/auto/quick/qquickpositioners/tst_qquickpositioners.cpp12
-rw-r--r--tests/auto/quick/qquickrectangle/tst_qquickrectangle.cpp2
-rw-r--r--tests/auto/quick/qquickrepeater/tst_qquickrepeater.cpp12
-rw-r--r--tests/auto/quick/qquickstates/tst_qquickstates.cpp16
-rw-r--r--tests/auto/quick/qquickstyledtext/tst_qquickstyledtext.cpp8
-rw-r--r--tests/auto/quick/qquicktableview/tst_qquicktableview.cpp16
-rw-r--r--tests/auto/quick/qquicktext/tst_qquicktext.cpp4
-rw-r--r--tests/auto/quick/qquicktreeview/tst_qquicktreeview.cpp12
-rw-r--r--tests/auto/quick/qquickview_extra/tst_qquickview_extra.cpp2
-rw-r--r--tests/auto/quick/qquickwindow/tst_qquickwindow.cpp8
-rw-r--r--tests/auto/quickcontrols2/qquicktreeviewdelegate/tst_qquicktreeviewdelegate.cpp8
-rw-r--r--tests/benchmarks/qml/compilation/tst_compilation.cpp2
-rw-r--r--tests/benchmarks/quickcontrols2/objectcount/tst_objectcount.cpp2
34 files changed, 212 insertions, 212 deletions
diff --git a/tests/auto/qml/animation/qsequentialanimationgroupjob/tst_qsequentialanimationgroupjob.cpp b/tests/auto/qml/animation/qsequentialanimationgroupjob/tst_qsequentialanimationgroupjob.cpp
index 2c9e74d24d..cc67df420c 100644
--- a/tests/auto/qml/animation/qsequentialanimationgroupjob/tst_qsequentialanimationgroupjob.cpp
+++ b/tests/auto/qml/animation/qsequentialanimationgroupjob/tst_qsequentialanimationgroupjob.cpp
@@ -562,8 +562,8 @@ typedef QList<QAbstractAnimationJob::State> StateList;
static bool compareStates(const StateChangeListener& spy, const StateList &expectedStates)
{
bool equals = true;
- for (int i = 0; i < qMax(expectedStates.count(), spy.count()); ++i) {
- if (i >= spy.count() || i >= expectedStates.count()) {
+ for (int i = 0; i < qMax(expectedStates.size(), spy.count()); ++i) {
+ if (i >= spy.count() || i >= expectedStates.size()) {
equals = false;
break;
}
@@ -577,8 +577,8 @@ static bool compareStates(const StateChangeListener& spy, const StateList &expec
if (!equals) {
const char *stateStrings[] = {"Stopped", "Paused", "Running"};
QString e,a;
- for (int i = 0; i < qMax(expectedStates.count(), spy.count()); ++i) {
- if (i < expectedStates.count()) {
+ for (int i = 0; i < qMax(expectedStates.size(), spy.count()); ++i) {
+ if (i < expectedStates.size()) {
int exp = int(expectedStates.at(i));
if (!e.isEmpty())
e += QLatin1String(", ");
@@ -596,7 +596,7 @@ static bool compareStates(const StateChangeListener& spy, const StateList &expec
}
}
- qDebug().noquote() << "\nexpected (count == " << expectedStates.count() << "): " << e
+ qDebug().noquote() << "\nexpected (count == " << expectedStates.size() << "): " << e
<< "\nactual (count == " << spy.count() << "): " << a << "\n";
}
return equals;
diff --git a/tests/auto/qml/debugger/qqmlenginedebugservice/tst_qqmlenginedebugservice.cpp b/tests/auto/qml/debugger/qqmlenginedebugservice/tst_qqmlenginedebugservice.cpp
index 578710a26e..ffde808bb4 100644
--- a/tests/auto/qml/debugger/qqmlenginedebugservice/tst_qqmlenginedebugservice.cpp
+++ b/tests/auto/qml/debugger/qqmlenginedebugservice/tst_qqmlenginedebugservice.cpp
@@ -210,7 +210,7 @@ void tst_QQmlEngineDebugService::recursiveObjectTest(
qmlContext(o)));
const QObjectList &children = o->children();
- for (int i=0; i<children.count(); i++) {
+ for (int i=0; i<children.size(); i++) {
QObject *child = children[i];
if (!qmlContext(child))
continue;
diff --git a/tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp b/tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp
index dfe92bb80b..53971d3e8b 100644
--- a/tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp
+++ b/tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp
@@ -357,9 +357,9 @@ bool tst_QQmlProfilerService::verify(tst_QQmlProfilerService::MessageListType ty
return false;
}
- if (target->length() <= expectedPosition) {
+ if (target->size() <= expectedPosition) {
qWarning() << "Not enough events. expected position:" << expectedPosition
- << "length:" << target->length();
+ << "length:" << target->size();
return false;
}
@@ -438,7 +438,7 @@ bool tst_QQmlProfilerService::verify(tst_QQmlProfilerService::MessageListType ty
}
return true;
- } while (++position < target->length() && target->at(position).timestamp() == timestamp);
+ } while (++position < target->size() && target->at(position).timestamp() == timestamp);
foreach (const QString &message, warnings)
qWarning() << message.toLocal8Bit().constData();
diff --git a/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp b/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp
index 23939e73fb..1b61451322 100644
--- a/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp
+++ b/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp
@@ -193,7 +193,7 @@ void tst_QmlCppCodegen::anchorsFill()
QVERIFY2(!object.isNull(), component.errorString().toUtf8().constData());
QCOMPARE(object->property("width").toInt(), 234);
- QCOMPARE(object->children().length(), 2);
+ QCOMPARE(object->children().size(), 2);
QObject *child = object->children().front();
QVERIFY(child);
@@ -625,7 +625,7 @@ void tst_QmlCppCodegen::conversions()
QCOMPARE(object->property("doneStuff").toInt(), 19);
QVariantList modulos = object->property("modulos").toList();
- QCOMPARE(modulos.length(), 7);
+ QCOMPARE(modulos.size(), 7);
QCOMPARE(modulos[0].userType(), QMetaType::Double);
QCOMPARE(modulos[0].toDouble(), 0.0);
@@ -649,7 +649,7 @@ void tst_QmlCppCodegen::conversions()
QVERIFY(qIsNaN(modulos[6].toDouble()));
QVariantList unaryOps = object->property("unaryOps").toList();
- QCOMPARE(unaryOps.length(), 6);
+ QCOMPARE(unaryOps.size(), 6);
QCOMPARE(unaryOps[0].userType(), QMetaType::Double);
QCOMPARE(unaryOps[0].toDouble(), 1221);
@@ -1790,7 +1790,7 @@ void tst_QmlCppCodegen::variantlist()
QVERIFY(o);
const QVariantList things = qvariant_cast<QVariantList>(o->property("things"));
- QCOMPARE(things.length(), 2);
+ QCOMPARE(things.size(), 2);
QCOMPARE(things[0].toString(), u"thing"_s);
QCOMPARE(things[1].toInt(), 30);
}
diff --git a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
index 2a853ae081..2922b02643 100644
--- a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
+++ b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
@@ -2854,26 +2854,26 @@ void tst_qqmlecmascript::callQtInvokables()
QVERIFY(EVALUATE_ERROR("object.method_nonexistent()"));
QCOMPARE(o->error(), false);
QCOMPARE(o->invoked(), -1);
- QCOMPARE(o->actuals().count(), 0);
+ QCOMPARE(o->actuals().size(), 0);
o->reset();
QVERIFY(EVALUATE_ERROR("object.method_nonexistent(10, 11)"));
QCOMPARE(o->error(), false);
QCOMPARE(o->invoked(), -1);
- QCOMPARE(o->actuals().count(), 0);
+ QCOMPARE(o->actuals().size(), 0);
// Insufficient arguments
o->reset();
QVERIFY(EVALUATE_ERROR("object.method_int()"));
QCOMPARE(o->error(), false);
QCOMPARE(o->invoked(), -1);
- QCOMPARE(o->actuals().count(), 0);
+ QCOMPARE(o->actuals().size(), 0);
o->reset();
QVERIFY(EVALUATE_ERROR("object.method_intint(10)"));
QCOMPARE(o->error(), false);
QCOMPARE(o->invoked(), -1);
- QCOMPARE(o->actuals().count(), 0);
+ QCOMPARE(o->actuals().size(), 0);
// Excessive arguments
QTest::ignoreMessage(QtWarningMsg, qPrintable("Too many arguments, ignoring 1"));
@@ -2882,7 +2882,7 @@ void tst_qqmlecmascript::callQtInvokables()
QVERIFY(EVALUATE_VALUE("object.method_int(10, 11)", QV4::Primitive::undefinedValue()));
QCOMPARE(o->error(), false);
QCOMPARE(o->invoked(), 8);
- QCOMPARE(o->actuals().count(), 1);
+ QCOMPARE(o->actuals().size(), 1);
QCOMPARE(o->actuals().at(0), QVariant(10));
QTest::ignoreMessage(QtWarningMsg, qPrintable("Too many arguments, ignoring 1"));
@@ -2891,7 +2891,7 @@ void tst_qqmlecmascript::callQtInvokables()
QVERIFY(EVALUATE_VALUE("object.method_intint(10, 11, 12)", QV4::Primitive::undefinedValue()));
QCOMPARE(o->error(), false);
QCOMPARE(o->invoked(), 9);
- QCOMPARE(o->actuals().count(), 2);
+ QCOMPARE(o->actuals().size(), 2);
QCOMPARE(o->actuals().at(0), QVariant(10));
QCOMPARE(o->actuals().at(1), QVariant(11));
@@ -2900,19 +2900,19 @@ void tst_qqmlecmascript::callQtInvokables()
QVERIFY(EVALUATE_VALUE("object.method_NoArgs()", QV4::Primitive::undefinedValue()));
QCOMPARE(o->error(), false);
QCOMPARE(o->invoked(), 0);
- QCOMPARE(o->actuals().count(), 0);
+ QCOMPARE(o->actuals().size(), 0);
o->reset();
QVERIFY(EVALUATE_VALUE("object.method_NoArgs_int()", QV4::Primitive::fromInt32(6)));
QCOMPARE(o->error(), false);
QCOMPARE(o->invoked(), 1);
- QCOMPARE(o->actuals().count(), 0);
+ QCOMPARE(o->actuals().size(), 0);
o->reset();
QVERIFY(EVALUATE_VALUE("object.method_NoArgs_real()", QV4::Primitive::fromDouble(19.75)));
QCOMPARE(o->error(), false);
QCOMPARE(o->invoked(), 2);
- QCOMPARE(o->actuals().count(), 0);
+ QCOMPARE(o->actuals().size(), 0);
o->reset();
{
@@ -2921,7 +2921,7 @@ void tst_qqmlecmascript::callQtInvokables()
QCOMPARE(QV4::ExecutionEngine::toVariant(ret, QMetaType {}), QVariant(QPointF(123, 4.5)));
QCOMPARE(o->error(), false);
QCOMPARE(o->invoked(), 3);
- QCOMPARE(o->actuals().count(), 0);
+ QCOMPARE(o->actuals().size(), 0);
}
o->reset();
@@ -2931,14 +2931,14 @@ void tst_qqmlecmascript::callQtInvokables()
QCOMPARE(qobjectWrapper->object(), (QObject *)o);
QCOMPARE(o->error(), false);
QCOMPARE(o->invoked(), 4);
- QCOMPARE(o->actuals().count(), 0);
+ QCOMPARE(o->actuals().size(), 0);
}
o->reset();
QVERIFY(EVALUATE_ERROR("object.method_NoArgs_unknown()"));
QCOMPARE(o->error(), false);
QCOMPARE(o->invoked(), -1);
- QCOMPARE(o->actuals().count(), 0);
+ QCOMPARE(o->actuals().size(), 0);
o->reset();
{
@@ -2947,63 +2947,63 @@ void tst_qqmlecmascript::callQtInvokables()
QCOMPARE(ret->toQStringNoThrow(), QString("Hello world"));
QCOMPARE(o->error(), false);
QCOMPARE(o->invoked(), 6);
- QCOMPARE(o->actuals().count(), 0);
+ QCOMPARE(o->actuals().size(), 0);
}
o->reset();
QVERIFY(EVALUATE_VALUE("object.method_NoArgs_QVariant()", QV4::ScopedValue(scope, scope.engine->newString("QML rocks"))));
QCOMPARE(o->error(), false);
QCOMPARE(o->invoked(), 7);
- QCOMPARE(o->actuals().count(), 0);
+ QCOMPARE(o->actuals().size(), 0);
// Test arg types
o->reset();
QVERIFY(EVALUATE_VALUE("object.method_int(94)", QV4::Primitive::undefinedValue()));
QCOMPARE(o->error(), false);
QCOMPARE(o->invoked(), 8);
- QCOMPARE(o->actuals().count(), 1);
+ QCOMPARE(o->actuals().size(), 1);
QCOMPARE(o->actuals().at(0), QVariant(94));
o->reset();
QVERIFY(EVALUATE_VALUE("object.method_int(\"94\")", QV4::Primitive::undefinedValue()));
QCOMPARE(o->error(), false);
QCOMPARE(o->invoked(), 8);
- QCOMPARE(o->actuals().count(), 1);
+ QCOMPARE(o->actuals().size(), 1);
QCOMPARE(o->actuals().at(0), QVariant(94));
o->reset();
QVERIFY(EVALUATE_VALUE("object.method_int(\"not a number\")", QV4::Primitive::undefinedValue()));
QCOMPARE(o->error(), false);
QCOMPARE(o->invoked(), 8);
- QCOMPARE(o->actuals().count(), 1);
+ QCOMPARE(o->actuals().size(), 1);
QCOMPARE(o->actuals().at(0), QVariant(0));
o->reset();
QVERIFY(EVALUATE_VALUE("object.method_int(null)", QV4::Primitive::undefinedValue()));
QCOMPARE(o->error(), false);
QCOMPARE(o->invoked(), 8);
- QCOMPARE(o->actuals().count(), 1);
+ QCOMPARE(o->actuals().size(), 1);
QCOMPARE(o->actuals().at(0), QVariant(0));
o->reset();
QVERIFY(EVALUATE_VALUE("object.method_int(undefined)", QV4::Primitive::undefinedValue()));
QCOMPARE(o->error(), false);
QCOMPARE(o->invoked(), 8);
- QCOMPARE(o->actuals().count(), 1);
+ QCOMPARE(o->actuals().size(), 1);
QCOMPARE(o->actuals().at(0), QVariant(0));
o->reset();
QVERIFY(EVALUATE_VALUE("object.method_int(object)", QV4::Primitive::undefinedValue()));
QCOMPARE(o->error(), false);
QCOMPARE(o->invoked(), 8);
- QCOMPARE(o->actuals().count(), 1);
+ QCOMPARE(o->actuals().size(), 1);
QCOMPARE(o->actuals().at(0), QVariant(0));
o->reset();
QVERIFY(EVALUATE_VALUE("object.method_intint(122, 9)", QV4::Primitive::undefinedValue()));
QCOMPARE(o->error(), false);
QCOMPARE(o->invoked(), 9);
- QCOMPARE(o->actuals().count(), 2);
+ QCOMPARE(o->actuals().size(), 2);
QCOMPARE(o->actuals().at(0), QVariant(122));
QCOMPARE(o->actuals().at(1), QVariant(9));
@@ -3011,56 +3011,56 @@ void tst_qqmlecmascript::callQtInvokables()
QVERIFY(EVALUATE_VALUE("object.method_real(94.3)", QV4::Primitive::undefinedValue()));
QCOMPARE(o->error(), false);
QCOMPARE(o->invoked(), 10);
- QCOMPARE(o->actuals().count(), 1);
+ QCOMPARE(o->actuals().size(), 1);
QCOMPARE(o->actuals().at(0), QVariant(94.3));
o->reset();
QVERIFY(EVALUATE_VALUE("object.method_real(\"94.3\")", QV4::Primitive::undefinedValue()));
QCOMPARE(o->error(), false);
QCOMPARE(o->invoked(), 10);
- QCOMPARE(o->actuals().count(), 1);
+ QCOMPARE(o->actuals().size(), 1);
QCOMPARE(o->actuals().at(0), QVariant(94.3));
o->reset();
QVERIFY(EVALUATE_VALUE("object.method_real(\"not a number\")", QV4::Primitive::undefinedValue()));
QCOMPARE(o->error(), false);
QCOMPARE(o->invoked(), 10);
- QCOMPARE(o->actuals().count(), 1);
+ QCOMPARE(o->actuals().size(), 1);
QVERIFY(qIsNaN(o->actuals().at(0).toDouble()));
o->reset();
QVERIFY(EVALUATE_VALUE("object.method_real(null)", QV4::Primitive::undefinedValue()));
QCOMPARE(o->error(), false);
QCOMPARE(o->invoked(), 10);
- QCOMPARE(o->actuals().count(), 1);
+ QCOMPARE(o->actuals().size(), 1);
QCOMPARE(o->actuals().at(0), QVariant(0));
o->reset();
QVERIFY(EVALUATE_VALUE("object.method_real(undefined)", QV4::Primitive::undefinedValue()));
QCOMPARE(o->error(), false);
QCOMPARE(o->invoked(), 10);
- QCOMPARE(o->actuals().count(), 1);
+ QCOMPARE(o->actuals().size(), 1);
QVERIFY(qIsNaN(o->actuals().at(0).toDouble()));
o->reset();
QVERIFY(EVALUATE_VALUE("object.method_real(object)", QV4::Primitive::undefinedValue()));
QCOMPARE(o->error(), false);
QCOMPARE(o->invoked(), 10);
- QCOMPARE(o->actuals().count(), 1);
+ QCOMPARE(o->actuals().size(), 1);
QVERIFY(qIsNaN(o->actuals().at(0).toDouble()));
o->reset();
QVERIFY(EVALUATE_VALUE("object.method_QString(\"Hello world\")", QV4::Primitive::undefinedValue()));
QCOMPARE(o->error(), false);
QCOMPARE(o->invoked(), 11);
- QCOMPARE(o->actuals().count(), 1);
+ QCOMPARE(o->actuals().size(), 1);
QCOMPARE(o->actuals().at(0), QVariant("Hello world"));
o->reset();
QVERIFY(EVALUATE_VALUE("object.method_QString(19)", QV4::Primitive::undefinedValue()));
QCOMPARE(o->error(), false);
QCOMPARE(o->invoked(), 11);
- QCOMPARE(o->actuals().count(), 1);
+ QCOMPARE(o->actuals().size(), 1);
QCOMPARE(o->actuals().at(0), QVariant("19"));
o->reset();
@@ -3069,7 +3069,7 @@ void tst_qqmlecmascript::callQtInvokables()
QVERIFY(EVALUATE_VALUE("object.method_QString(object)", QV4::Primitive::undefinedValue()));
QCOMPARE(o->error(), false);
QCOMPARE(o->invoked(), 11);
- QCOMPARE(o->actuals().count(), 1);
+ QCOMPARE(o->actuals().size(), 1);
QCOMPARE(o->actuals().at(0), QVariant(expected));
}
@@ -3077,71 +3077,71 @@ void tst_qqmlecmascript::callQtInvokables()
QVERIFY(EVALUATE_VALUE("object.method_QString(null)", QV4::Primitive::undefinedValue()));
QCOMPARE(o->error(), false);
QCOMPARE(o->invoked(), 11);
- QCOMPARE(o->actuals().count(), 1);
+ QCOMPARE(o->actuals().size(), 1);
QCOMPARE(o->actuals().at(0), QVariant(QString()));
o->reset();
QVERIFY(EVALUATE_VALUE("object.method_QString(undefined)", QV4::Primitive::undefinedValue()));
QCOMPARE(o->error(), false);
QCOMPARE(o->invoked(), 11);
- QCOMPARE(o->actuals().count(), 1);
+ QCOMPARE(o->actuals().size(), 1);
QCOMPARE(o->actuals().at(0), QVariant(QString()));
o->reset();
QVERIFY(EVALUATE_ERROR("object.method_QPointF(0)"));
QCOMPARE(o->error(), false);
QCOMPARE(o->invoked(), -1);
- QCOMPARE(o->actuals().count(), 0);
+ QCOMPARE(o->actuals().size(), 0);
o->reset();
QVERIFY(EVALUATE_ERROR("object.method_QPointF(null)"));
QCOMPARE(o->error(), false);
QCOMPARE(o->invoked(), -1);
- QCOMPARE(o->actuals().count(), 0);
+ QCOMPARE(o->actuals().size(), 0);
o->reset();
QVERIFY(EVALUATE_ERROR("object.method_QPointF(undefined)"));
QCOMPARE(o->error(), false);
QCOMPARE(o->invoked(), -1);
- QCOMPARE(o->actuals().count(), 0);
+ QCOMPARE(o->actuals().size(), 0);
o->reset();
QVERIFY(EVALUATE_ERROR("object.method_QPointF(object)"));
QCOMPARE(o->error(), false);
QCOMPARE(o->invoked(), -1);
- QCOMPARE(o->actuals().count(), 0);
+ QCOMPARE(o->actuals().size(), 0);
o->reset();
QVERIFY(EVALUATE_VALUE("object.method_QPointF(object.method_get_QPointF())", QV4::Primitive::undefinedValue()));
QCOMPARE(o->error(), false);
QCOMPARE(o->invoked(), 12);
- QCOMPARE(o->actuals().count(), 1);
+ QCOMPARE(o->actuals().size(), 1);
QCOMPARE(o->actuals().at(0), QVariant(QPointF(99.3, -10.2)));
o->reset();
QVERIFY(EVALUATE_VALUE("object.method_QPointF(object.method_get_QPoint())", QV4::Primitive::undefinedValue()));
QCOMPARE(o->error(), false);
QCOMPARE(o->invoked(), 12);
- QCOMPARE(o->actuals().count(), 1);
+ QCOMPARE(o->actuals().size(), 1);
QCOMPARE(o->actuals().at(0), QVariant(QPointF(9, 12)));
o->reset();
QVERIFY(EVALUATE_ERROR("object.method_QObject(0)"));
QCOMPARE(o->error(), false);
QCOMPARE(o->invoked(), -1);
- QCOMPARE(o->actuals().count(), 0);
+ QCOMPARE(o->actuals().size(), 0);
o->reset();
QVERIFY(EVALUATE_ERROR("object.method_QObject(\"Hello world\")"));
QCOMPARE(o->error(), false);
QCOMPARE(o->invoked(), -1);
- QCOMPARE(o->actuals().count(), 0);
+ QCOMPARE(o->actuals().size(), 0);
o->reset();
QVERIFY(EVALUATE_VALUE("object.method_QObject(null)", QV4::Primitive::undefinedValue()));
QCOMPARE(o->error(), false);
QCOMPARE(o->invoked(), 13);
- QCOMPARE(o->actuals().count(), 1);
+ QCOMPARE(o->actuals().size(), 1);
QCOMPARE(o->actuals().at(0), QVariant::fromValue((QObject *)nullptr));
{
@@ -3151,7 +3151,7 @@ void tst_qqmlecmascript::callQtInvokables()
QVERIFY(root);
QCOMPARE(o->error(), false);
QCOMPARE(o->invoked(), 13);
- QCOMPARE(o->actuals().count(), 1);
+ QCOMPARE(o->actuals().size(), 1);
QCOMPARE(o->actuals().at(0).value<QObject *>()->metaObject()->className(), "QQmlComponentAttached");
}
@@ -3168,49 +3168,49 @@ void tst_qqmlecmascript::callQtInvokables()
QVERIFY(EVALUATE_VALUE("object.method_QObject(undefined)", QV4::Primitive::undefinedValue()));
QCOMPARE(o->error(), false);
QCOMPARE(o->invoked(), 13);
- QCOMPARE(o->actuals().count(), 1);
+ QCOMPARE(o->actuals().size(), 1);
QCOMPARE(o->actuals().at(0), QVariant::fromValue((QObject *)nullptr));
o->reset();
QVERIFY(EVALUATE_VALUE("object.method_QObject(object)", QV4::Primitive::undefinedValue()));
QCOMPARE(o->error(), false);
QCOMPARE(o->invoked(), 13);
- QCOMPARE(o->actuals().count(), 1);
+ QCOMPARE(o->actuals().size(), 1);
QCOMPARE(o->actuals().at(0), QVariant::fromValue((QObject *)o));
o->reset();
QVERIFY(EVALUATE_VALUE("object.method_QScriptValue(null)", QV4::Primitive::undefinedValue()));
QCOMPARE(o->error(), false);
QCOMPARE(o->invoked(), 14);
- QCOMPARE(o->actuals().count(), 1);
+ QCOMPARE(o->actuals().size(), 1);
QVERIFY(qvariant_cast<QJSValue>(o->actuals().at(0)).isNull());
o->reset();
QVERIFY(EVALUATE_VALUE("object.method_QScriptValue(undefined)", QV4::Primitive::undefinedValue()));
QCOMPARE(o->error(), false);
QCOMPARE(o->invoked(), 14);
- QCOMPARE(o->actuals().count(), 1);
+ QCOMPARE(o->actuals().size(), 1);
QVERIFY(qvariant_cast<QJSValue>(o->actuals().at(0)).isUndefined());
o->reset();
QVERIFY(EVALUATE_VALUE("object.method_QScriptValue(19)", QV4::Primitive::undefinedValue()));
QCOMPARE(o->error(), false);
QCOMPARE(o->invoked(), 14);
- QCOMPARE(o->actuals().count(), 1);
+ QCOMPARE(o->actuals().size(), 1);
QVERIFY(qvariant_cast<QJSValue>(o->actuals().at(0)).strictlyEquals(QJSValue(19)));
o->reset();
QVERIFY(EVALUATE_VALUE("object.method_QScriptValue([19, 20])", QV4::Primitive::undefinedValue()));
QCOMPARE(o->error(), false);
QCOMPARE(o->invoked(), 14);
- QCOMPARE(o->actuals().count(), 1);
+ QCOMPARE(o->actuals().size(), 1);
QVERIFY(qvariant_cast<QJSValue>(o->actuals().at(0)).isArray());
o->reset();
QVERIFY(EVALUATE_VALUE("object.method_intQScriptValue(4, null)", QV4::Primitive::undefinedValue()));
QCOMPARE(o->error(), false);
QCOMPARE(o->invoked(), 15);
- QCOMPARE(o->actuals().count(), 2);
+ QCOMPARE(o->actuals().size(), 2);
QCOMPARE(o->actuals().at(0), QVariant(4));
QVERIFY(qvariant_cast<QJSValue>(o->actuals().at(1)).isNull());
@@ -3218,7 +3218,7 @@ void tst_qqmlecmascript::callQtInvokables()
QVERIFY(EVALUATE_VALUE("object.method_intQScriptValue(8, undefined)", QV4::Primitive::undefinedValue()));
QCOMPARE(o->error(), false);
QCOMPARE(o->invoked(), 15);
- QCOMPARE(o->actuals().count(), 2);
+ QCOMPARE(o->actuals().size(), 2);
QCOMPARE(o->actuals().at(0), QVariant(8));
QVERIFY(qvariant_cast<QJSValue>(o->actuals().at(1)).isUndefined());
@@ -3226,7 +3226,7 @@ void tst_qqmlecmascript::callQtInvokables()
QVERIFY(EVALUATE_VALUE("object.method_intQScriptValue(3, 19)", QV4::Primitive::undefinedValue()));
QCOMPARE(o->error(), false);
QCOMPARE(o->invoked(), 15);
- QCOMPARE(o->actuals().count(), 2);
+ QCOMPARE(o->actuals().size(), 2);
QCOMPARE(o->actuals().at(0), QVariant(3));
QVERIFY(qvariant_cast<QJSValue>(o->actuals().at(1)).strictlyEquals(QJSValue(19)));
@@ -3234,7 +3234,7 @@ void tst_qqmlecmascript::callQtInvokables()
QVERIFY(EVALUATE_VALUE("object.method_intQScriptValue(44, [19, 20])", QV4::Primitive::undefinedValue()));
QCOMPARE(o->error(), false);
QCOMPARE(o->invoked(), 15);
- QCOMPARE(o->actuals().count(), 2);
+ QCOMPARE(o->actuals().size(), 2);
QCOMPARE(o->actuals().at(0), QVariant(44));
QVERIFY(qvariant_cast<QJSValue>(o->actuals().at(1)).isArray());
@@ -3242,20 +3242,20 @@ void tst_qqmlecmascript::callQtInvokables()
QVERIFY(EVALUATE_ERROR("object.method_overload()"));
QCOMPARE(o->error(), false);
QCOMPARE(o->invoked(), -1);
- QCOMPARE(o->actuals().count(), 0);
+ QCOMPARE(o->actuals().size(), 0);
o->reset();
QVERIFY(EVALUATE_VALUE("object.method_overload(10)", QV4::Primitive::undefinedValue()));
QCOMPARE(o->error(), false);
QCOMPARE(o->invoked(), 16);
- QCOMPARE(o->actuals().count(), 1);
+ QCOMPARE(o->actuals().size(), 1);
QCOMPARE(o->actuals().at(0), QVariant(10));
o->reset();
QVERIFY(EVALUATE_VALUE("object.method_overload(10, 11)", QV4::Primitive::undefinedValue()));
QCOMPARE(o->error(), false);
QCOMPARE(o->invoked(), 17);
- QCOMPARE(o->actuals().count(), 2);
+ QCOMPARE(o->actuals().size(), 2);
QCOMPARE(o->actuals().at(0), QVariant(10));
QCOMPARE(o->actuals().at(1), QVariant(11));
@@ -3263,21 +3263,21 @@ void tst_qqmlecmascript::callQtInvokables()
QVERIFY(EVALUATE_VALUE("object.method_overload(\"Hello\")", QV4::Primitive::undefinedValue()));
QCOMPARE(o->error(), false);
QCOMPARE(o->invoked(), 18);
- QCOMPARE(o->actuals().count(), 1);
+ QCOMPARE(o->actuals().size(), 1);
QCOMPARE(o->actuals().at(0), QVariant(QString("Hello")));
o->reset();
QVERIFY(EVALUATE_VALUE("object.method_with_enum(9)", QV4::Primitive::undefinedValue()));
QCOMPARE(o->error(), false);
QCOMPARE(o->invoked(), 19);
- QCOMPARE(o->actuals().count(), 1);
+ QCOMPARE(o->actuals().size(), 1);
QCOMPARE(o->actuals().at(0), QVariant(9));
o->reset();
QVERIFY(EVALUATE_VALUE("object.method_default(10)", QV4::Primitive::fromInt32(19)));
QCOMPARE(o->error(), false);
QCOMPARE(o->invoked(), 20);
- QCOMPARE(o->actuals().count(), 2);
+ QCOMPARE(o->actuals().size(), 2);
QCOMPARE(o->actuals().at(0), QVariant(10));
QCOMPARE(o->actuals().at(1), QVariant(19));
@@ -3285,7 +3285,7 @@ void tst_qqmlecmascript::callQtInvokables()
QVERIFY(EVALUATE_VALUE("object.method_default(10, 13)", QV4::Primitive::fromInt32(13)));
QCOMPARE(o->error(), false);
QCOMPARE(o->invoked(), 20);
- QCOMPARE(o->actuals().count(), 2);
+ QCOMPARE(o->actuals().size(), 2);
QCOMPARE(o->actuals().at(0), QVariant(10));
QCOMPARE(o->actuals().at(1), QVariant(13));
@@ -3293,14 +3293,14 @@ void tst_qqmlecmascript::callQtInvokables()
QVERIFY(EVALUATE_VALUE("object.method_inherited(9)", QV4::Primitive::undefinedValue()));
QCOMPARE(o->error(), false);
QCOMPARE(o->invoked(), -3);
- QCOMPARE(o->actuals().count(), 1);
+ QCOMPARE(o->actuals().size(), 1);
QCOMPARE(o->actuals().at(0), QVariant(9));
o->reset();
QVERIFY(EVALUATE_VALUE("object.method_QVariant(9)", QV4::Primitive::undefinedValue()));
QCOMPARE(o->error(), false);
QCOMPARE(o->invoked(), 21);
- QCOMPARE(o->actuals().count(), 2);
+ QCOMPARE(o->actuals().size(), 2);
QCOMPARE(o->actuals().at(0), QVariant(9));
QCOMPARE(o->actuals().at(1), QVariant());
@@ -3308,7 +3308,7 @@ void tst_qqmlecmascript::callQtInvokables()
QVERIFY(EVALUATE_VALUE("object.method_QVariant(\"Hello\", \"World\")", QV4::Primitive::undefinedValue()));
QCOMPARE(o->error(), false);
QCOMPARE(o->invoked(), 21);
- QCOMPARE(o->actuals().count(), 2);
+ QCOMPARE(o->actuals().size(), 2);
QCOMPARE(o->actuals().at(0), QVariant(QString("Hello")));
QCOMPARE(o->actuals().at(1), QVariant(QString("World")));
@@ -3316,104 +3316,104 @@ void tst_qqmlecmascript::callQtInvokables()
QVERIFY(EVALUATE_VALUE("object.method_QJsonObject({foo:123})", QV4::Primitive::undefinedValue()));
QCOMPARE(o->error(), false);
QCOMPARE(o->invoked(), 22);
- QCOMPARE(o->actuals().count(), 1);
+ QCOMPARE(o->actuals().size(), 1);
QCOMPARE(qvariant_cast<QJsonObject>(o->actuals().at(0)), QJsonDocument::fromJson("{\"foo\":123}").object());
o->reset();
QVERIFY(EVALUATE_VALUE("object.method_QJsonArray([123])", QV4::Primitive::undefinedValue()));
QCOMPARE(o->error(), false);
QCOMPARE(o->invoked(), 23);
- QCOMPARE(o->actuals().count(), 1);
+ QCOMPARE(o->actuals().size(), 1);
QCOMPARE(qvariant_cast<QJsonArray>(o->actuals().at(0)), QJsonDocument::fromJson("[123]").array());
o->reset();
QVERIFY(EVALUATE_VALUE("object.method_QJsonValue(123)", QV4::Primitive::undefinedValue()));
QCOMPARE(o->error(), false);
QCOMPARE(o->invoked(), 24);
- QCOMPARE(o->actuals().count(), 1);
+ QCOMPARE(o->actuals().size(), 1);
QCOMPARE(qvariant_cast<QJsonValue>(o->actuals().at(0)), QJsonValue(123));
o->reset();
QVERIFY(EVALUATE_VALUE("object.method_QJsonValue(42.35)", QV4::Primitive::undefinedValue()));
QCOMPARE(o->error(), false);
QCOMPARE(o->invoked(), 24);
- QCOMPARE(o->actuals().count(), 1);
+ QCOMPARE(o->actuals().size(), 1);
QCOMPARE(qvariant_cast<QJsonValue>(o->actuals().at(0)), QJsonValue(42.35));
o->reset();
QVERIFY(EVALUATE_VALUE("object.method_QJsonValue('ciao')", QV4::Primitive::undefinedValue()));
QCOMPARE(o->error(), false);
QCOMPARE(o->invoked(), 24);
- QCOMPARE(o->actuals().count(), 1);
+ QCOMPARE(o->actuals().size(), 1);
QCOMPARE(qvariant_cast<QJsonValue>(o->actuals().at(0)), QJsonValue(QStringLiteral("ciao")));
o->reset();
QVERIFY(EVALUATE_VALUE("object.method_QJsonValue(true)", QV4::Primitive::undefinedValue()));
QCOMPARE(o->error(), false);
QCOMPARE(o->invoked(), 24);
- QCOMPARE(o->actuals().count(), 1);
+ QCOMPARE(o->actuals().size(), 1);
QCOMPARE(qvariant_cast<QJsonValue>(o->actuals().at(0)), QJsonValue(true));
o->reset();
QVERIFY(EVALUATE_VALUE("object.method_QJsonValue(false)", QV4::Primitive::undefinedValue()));
QCOMPARE(o->error(), false);
QCOMPARE(o->invoked(), 24);
- QCOMPARE(o->actuals().count(), 1);
+ QCOMPARE(o->actuals().size(), 1);
QCOMPARE(qvariant_cast<QJsonValue>(o->actuals().at(0)), QJsonValue(false));
o->reset();
QVERIFY(EVALUATE_VALUE("object.method_QJsonValue(null)", QV4::Primitive::undefinedValue()));
QCOMPARE(o->error(), false);
QCOMPARE(o->invoked(), 24);
- QCOMPARE(o->actuals().count(), 1);
+ QCOMPARE(o->actuals().size(), 1);
QCOMPARE(qvariant_cast<QJsonValue>(o->actuals().at(0)), QJsonValue(QJsonValue::Null));
o->reset();
QVERIFY(EVALUATE_VALUE("object.method_QJsonValue(undefined)", QV4::Primitive::undefinedValue()));
QCOMPARE(o->error(), false);
QCOMPARE(o->invoked(), 24);
- QCOMPARE(o->actuals().count(), 1);
+ QCOMPARE(o->actuals().size(), 1);
QCOMPARE(qvariant_cast<QJsonValue>(o->actuals().at(0)), QJsonValue(QJsonValue::Undefined));
o->reset();
QVERIFY(EVALUATE_VALUE("object.method_overload({foo:123})", QV4::Primitive::undefinedValue()));
QCOMPARE(o->error(), false);
QCOMPARE(o->invoked(), 25);
- QCOMPARE(o->actuals().count(), 1);
+ QCOMPARE(o->actuals().size(), 1);
QCOMPARE(qvariant_cast<QJsonObject>(o->actuals().at(0)), QJsonDocument::fromJson("{\"foo\":123}").object());
o->reset();
QVERIFY(EVALUATE_VALUE("object.method_overload([123])", QV4::Primitive::undefinedValue()));
QCOMPARE(o->error(), false);
QCOMPARE(o->invoked(), 26);
- QCOMPARE(o->actuals().count(), 1);
+ QCOMPARE(o->actuals().size(), 1);
QCOMPARE(qvariant_cast<QJsonArray>(o->actuals().at(0)), QJsonDocument::fromJson("[123]").array());
o->reset();
QVERIFY(EVALUATE_VALUE("object.method_overload(null)", QV4::Primitive::undefinedValue()));
QCOMPARE(o->error(), false);
QCOMPARE(o->invoked(), 27);
- QCOMPARE(o->actuals().count(), 1);
+ QCOMPARE(o->actuals().size(), 1);
QCOMPARE(qvariant_cast<QJsonValue>(o->actuals().at(0)), QJsonValue(QJsonValue::Null));
o->reset();
QVERIFY(EVALUATE_VALUE("object.method_overload(undefined)", QV4::Primitive::undefinedValue()));
QCOMPARE(o->error(), false);
QCOMPARE(o->invoked(), 27);
- QCOMPARE(o->actuals().count(), 1);
+ QCOMPARE(o->actuals().size(), 1);
QCOMPARE(qvariant_cast<QJsonValue>(o->actuals().at(0)), QJsonValue(QJsonValue::Undefined));
o->reset();
QVERIFY(EVALUATE_ERROR("object.method_unknown(null)"));
QCOMPARE(o->error(), false);
QCOMPARE(o->invoked(), -1);
- QCOMPARE(o->actuals().count(), 0);
+ QCOMPARE(o->actuals().size(), 0);
o->reset();
QVERIFY(EVALUATE_VALUE("object.method_QByteArray(\"Hello\")", QV4::Primitive::undefinedValue()));
QCOMPARE(o->error(), false);
QCOMPARE(o->invoked(), 29);
- QCOMPARE(o->actuals().count(), 1);
+ QCOMPARE(o->actuals().size(), 1);
QCOMPARE(qvariant_cast<QByteArray>(o->actuals().at(0)), QByteArray("Hello"));
o->reset();
@@ -3422,7 +3422,7 @@ void tst_qqmlecmascript::callQtInvokables()
QCOMPARE(o->invoked(), 30);
QVERIFY(ret->isString());
QCOMPARE(ret->toQStringNoThrow(), QString("Hello world!"));
- QCOMPARE(o->actuals().count(), 2);
+ QCOMPARE(o->actuals().size(), 2);
QCOMPARE(o->actuals().at(0), QVariant(123));
QJSValue callback = qvariant_cast<QJSValue>(o->actuals().at(1));
QVERIFY(!callback.isNull());
@@ -3432,7 +3432,7 @@ void tst_qqmlecmascript::callQtInvokables()
QVERIFY(EVALUATE_VALUE("object.method_overload2('foo', 12, [1, 2, 3])", QV4::Primitive::undefinedValue()));
QCOMPARE(o->error(), false);
QCOMPARE(o->invoked(), 31);
- QCOMPARE(o->actuals().count(), 3);
+ QCOMPARE(o->actuals().size(), 3);
QCOMPARE(qvariant_cast<QString>(o->actuals().at(0)), QStringLiteral("foo"));
QCOMPARE(qvariant_cast<int>(o->actuals().at(1)), 12);
QCOMPARE(qvariant_cast<QVariantList>(o->actuals().at(2)), (QVariantList {1.0, 2.0, 3.0}));
@@ -3441,7 +3441,7 @@ void tst_qqmlecmascript::callQtInvokables()
QVERIFY(EVALUATE_VALUE("object.method_overload2(11, 12, {a: 1, b: 2})", QV4::Primitive::undefinedValue()));
QCOMPARE(o->error(), false);
QCOMPARE(o->invoked(), 31);
- QCOMPARE(o->actuals().count(), 3);
+ QCOMPARE(o->actuals().size(), 3);
QCOMPARE(qvariant_cast<int>(o->actuals().at(0)), 11);
QCOMPARE(qvariant_cast<int>(o->actuals().at(1)), 12);
QCOMPARE(qvariant_cast<QVariantMap>(o->actuals().at(2)),
@@ -3452,7 +3452,7 @@ void tst_qqmlecmascript::callQtInvokables()
QV4::Primitive::undefinedValue()));
QCOMPARE(o->error(), false);
QCOMPARE(o->invoked(), 32);
- QCOMPARE(o->actuals().count(), 1);
+ QCOMPARE(o->actuals().size(), 1);
QCOMPARE(qvariant_cast<QVariantList>(o->actuals().at(0)),
(QVariantList {1.0, QStringLiteral("bar"), 0.2}));
@@ -3461,7 +3461,7 @@ void tst_qqmlecmascript::callQtInvokables()
QV4::Primitive::undefinedValue()));
QCOMPARE(o->error(), false);
QCOMPARE(o->invoked(), 33);
- QCOMPARE(o->actuals().count(), 1);
+ QCOMPARE(o->actuals().size(), 1);
QCOMPARE(qvariant_cast<QVariantMap>(o->actuals().at(0)),
(QVariantMap {
{QStringLiteral("one"), 1.0},
diff --git a/tests/auto/qml/qqmlengine/tst_qqmlengine.cpp b/tests/auto/qml/qqmlengine/tst_qqmlengine.cpp
index 6e74de7d86..8a15cf906a 100644
--- a/tests/auto/qml/qqmlengine/tst_qqmlengine.cpp
+++ b/tests/auto/qml/qqmlengine/tst_qqmlengine.cpp
@@ -317,7 +317,7 @@ void tst_qqmlengine::offlineStoragePath()
QSignalSpy offlineStoragePathSpy(&engine, &QQmlEngine::offlineStoragePathChanged);
engine.setOfflineStoragePath(QDir::homePath());
- QCOMPARE(offlineStoragePathSpy.count(), 1);
+ QCOMPARE(offlineStoragePathSpy.size(), 1);
QCOMPARE(engine.offlineStoragePath(), QDir::homePath());
}
diff --git a/tests/auto/qml/qqmlitemmodels/tst_qqmlitemmodels.cpp b/tests/auto/qml/qqmlitemmodels/tst_qqmlitemmodels.cpp
index fc5164629e..339a61f996 100644
--- a/tests/auto/qml/qqmlitemmodels/tst_qqmlitemmodels.cpp
+++ b/tests/auto/qml/qqmlitemmodels/tst_qqmlitemmodels.cpp
@@ -181,7 +181,7 @@ void tst_qqmlitemmodels::modelIndexList()
QCOMPARE(object->property("count").toInt(), 10);
const QModelIndexList &mil = object->modelIndexList();
- QCOMPARE(mil.count(), 4);
+ QCOMPARE(mil.size(), 4);
for (int i = 0; i < 3; i++)
QCOMPARE(mil.at(i), model.index(2 + i, 2 + i));
QCOMPARE(mil.at(3), QModelIndex()); // The string inserted at the end should result in an invalid index
@@ -198,7 +198,7 @@ void tst_qqmlitemmodels::modelIndexList()
QCOMPARE(milVariant.userType(), qMetaTypeId<QModelIndexList>());
const QModelIndexList &milProp = milVariant.value<QModelIndexList>();
- QCOMPARE(milProp.count(), mil.count());
+ QCOMPARE(milProp.size(), mil.size());
QCOMPARE(milProp, mil);
}
}
diff --git a/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp b/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp
index 254b19c9e2..904f54912c 100644
--- a/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp
+++ b/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp
@@ -779,7 +779,7 @@ void tst_qqmllanguage::simpleContainer()
VERIFY_ERRORS(0);
QScopedPointer<MyContainer> container(qobject_cast<MyContainer*>(component.create()));
QVERIFY(container != nullptr);
- QCOMPARE(container->getChildren()->count(),2);
+ QCOMPARE(container->getChildren()->size(),2);
}
void tst_qqmllanguage::interfaceProperty()
@@ -798,7 +798,7 @@ void tst_qqmllanguage::interfaceQList()
VERIFY_ERRORS(0);
QScopedPointer<MyContainer> container(qobject_cast<MyContainer*>(component.create()));
QVERIFY(container != nullptr);
- QCOMPARE(container->getQListInterfaces()->count(), 2);
+ QCOMPARE(container->getQListInterfaces()->size(), 2);
for(int ii = 0; ii < 2; ++ii)
QCOMPARE(container->getQListInterfaces()->at(ii)->id, 913);
}
@@ -839,7 +839,7 @@ void tst_qqmllanguage::assignQmlComponent()
VERIFY_ERRORS(0);
QScopedPointer<MyContainer> object(qobject_cast<MyContainer *>(component.create()));
QVERIFY(object != nullptr);
- QCOMPARE(object->getChildren()->count(), 1);
+ QCOMPARE(object->getChildren()->size(), 1);
QObject *child = object->getChildren()->at(0);
QCOMPARE(child->property("x"), QVariant(10));
QCOMPARE(child->property("y"), QVariant(11));
@@ -1365,7 +1365,7 @@ void tst_qqmllanguage::rootAsQmlComponent()
QScopedPointer<MyContainer> object(qobject_cast<MyContainer *>(component.create()));
QVERIFY(object != nullptr);
QCOMPARE(object->property("x"), QVariant(11));
- QCOMPARE(object->getChildren()->count(), 2);
+ QCOMPARE(object->getChildren()->size(), 2);
}
void tst_qqmllanguage::rootItemIsComponent()
@@ -1397,7 +1397,7 @@ void tst_qqmllanguage::inlineQmlComponents()
VERIFY_ERRORS(0);
QScopedPointer<MyContainer> object(qobject_cast<MyContainer *>(component.create()));
QVERIFY(object != nullptr);
- QCOMPARE(object->getChildren()->count(), 1);
+ QCOMPARE(object->getChildren()->size(), 1);
QQmlComponent *comp = qobject_cast<QQmlComponent *>(object->getChildren()->at(0));
QVERIFY(comp != nullptr);
QScopedPointer<MyQmlObject> compObject(qobject_cast<MyQmlObject *>(comp->create()));
@@ -1413,7 +1413,7 @@ void tst_qqmllanguage::idProperty()
VERIFY_ERRORS(0);
QScopedPointer<MyContainer> object(qobject_cast<MyContainer *>(component.create()));
QVERIFY(object != nullptr);
- QCOMPARE(object->getChildren()->count(), 2);
+ QCOMPARE(object->getChildren()->size(), 2);
MyTypeObject *child =
qobject_cast<MyTypeObject *>(object->getChildren()->at(0));
QVERIFY(child != nullptr);
@@ -2704,7 +2704,7 @@ void tst_qqmllanguage::defaultPropertyListOrder()
QScopedPointer<MyContainer> container(qobject_cast<MyContainer *>(component.create()));
QVERIFY(container != nullptr);
- QCOMPARE(container->getChildren()->count(), 6);
+ QCOMPARE(container->getChildren()->size(), 6);
QCOMPARE(container->getChildren()->at(0)->property("index"), QVariant(0));
QCOMPARE(container->getChildren()->at(1)->property("index"), QVariant(1));
QCOMPARE(container->getChildren()->at(2)->property("index"), QVariant(2));
@@ -5144,7 +5144,7 @@ void tst_qqmllanguage::executeDeferredPropertiesOnce()
QVERIFY(innerObjsAfterFirstExecute.isEmpty());
QObjectList outerObjsAfterFirstExecute = object->findChildren<QObject *>(QStringLiteral("outerobj")); // deferredListProperty.qml
- QCOMPARE(outerObjsAfterFirstExecute.count(), 1);
+ QCOMPARE(outerObjsAfterFirstExecute.size(), 1);
QCOMPARE(outerObjsAfterFirstExecute.first()->property("wasCompleted"), QVariant(true));
groupProperty = object->property("groupProperty").value<QObject *>();
@@ -6920,7 +6920,7 @@ void tst_qqmllanguage::variantListConversion()
Foo *foo = qobject_cast<Foo *>(o.data());
QVERIFY(foo);
const QVariantList list = foo->getList();
- QCOMPARE(list.length(), 3);
+ QCOMPARE(list.size(), 3);
const Large l0 = qvariant_cast<Large>(list.at(0));
QCOMPARE(l0.a, 12ull);
const Large l1 = qvariant_cast<Large>(list.at(1));
diff --git a/tests/auto/qml/qqmllistmodel/tst_qqmllistmodel.cpp b/tests/auto/qml/qqmllistmodel/tst_qqmllistmodel.cpp
index 5550d2788e..8b07398832 100644
--- a/tests/auto/qml/qqmllistmodel/tst_qqmllistmodel.cpp
+++ b/tests/auto/qml/qqmllistmodel/tst_qqmllistmodel.cpp
@@ -128,10 +128,10 @@ bool tst_qqmllistmodel::compareVariantList(const QVariantList &testList, QVarian
if (model == nullptr)
return false;
- if (model->count() != testList.count())
+ if (model->count() != testList.size())
return false;
- for (int i=0 ; i < testList.count() ; ++i) {
+ for (int i=0 ; i < testList.size() ; ++i) {
const QVariant &testVariant = testList.at(i);
if (testVariant.typeId() != QMetaType::QVariantMap)
return false;
diff --git a/tests/auto/qml/qqmllistmodelworkerscript/tst_qqmllistmodelworkerscript.cpp b/tests/auto/qml/qqmllistmodelworkerscript/tst_qqmllistmodelworkerscript.cpp
index ae7f2ce19b..4875602314 100644
--- a/tests/auto/qml/qqmllistmodelworkerscript/tst_qqmllistmodelworkerscript.cpp
+++ b/tests/auto/qml/qqmllistmodelworkerscript/tst_qqmllistmodelworkerscript.cpp
@@ -91,10 +91,10 @@ bool tst_qqmllistmodelworkerscript::compareVariantList(const QVariantList &testL
if (model == nullptr)
return false;
- if (model->count() != testList.count())
+ if (model->count() != testList.size())
return false;
- for (int i=0 ; i < testList.count() ; ++i) {
+ for (int i=0 ; i < testList.size() ; ++i) {
const QVariant &testVariant = testList.at(i);
if (testVariant.typeId() != QMetaType::QVariantMap)
return false;
@@ -394,7 +394,7 @@ void tst_qqmllistmodelworkerscript::dynamic_worker_sync()
// execute a set of commands on the worker list model, then check the
// changes are reflected in the list model in the main thread
QVERIFY(QMetaObject::invokeMethod(item, "evalExpressionViaWorker",
- Q_ARG(QVariant, operations.mid(0, operations.length()-1))));
+ Q_ARG(QVariant, operations.mid(0, operations.size()-1))));
waitForWorker(item);
QQmlExpression e(eng.rootContext(), &model, operations.last().toString());
@@ -809,7 +809,7 @@ void tst_qqmllistmodelworkerscript::dynamic_role()
// execute a set of commands on the worker list model, then check the
// changes are reflected in the list model in the main thread
QVERIFY(QMetaObject::invokeMethod(item, "evalExpressionViaWorker",
- Q_ARG(QVariant, operations.mid(0, operations.length()-1))));
+ Q_ARG(QVariant, operations.mid(0, operations.size()-1))));
waitForWorker(item);
QQmlExpression e(engine.rootContext(), &model, operations.last().toString());
diff --git a/tests/auto/qml/qqmllistreference/tst_qqmllistreference.cpp b/tests/auto/qml/qqmllistreference/tst_qqmllistreference.cpp
index 29b2f1d122..049ffb2d72 100644
--- a/tests/auto/qml/qqmllistreference/tst_qqmllistreference.cpp
+++ b/tests/auto/qml/qqmllistreference/tst_qqmllistreference.cpp
@@ -80,7 +80,7 @@ public:
reinterpret_cast<QList<TestType *> *>(p->data)->append(v);
}
static qsizetype count(QQmlListProperty<TestType> *p) {
- return reinterpret_cast<QList<TestType *> *>(p->data)->count();
+ return reinterpret_cast<QList<TestType *> *>(p->data)->size();
}
static TestType *at(QQmlListProperty<TestType> *p, qsizetype idx) {
return reinterpret_cast<QList<TestType *> *>(p->data)->at(idx);
diff --git a/tests/auto/qml/qqmlobjectmodel/tst_qqmlobjectmodel.cpp b/tests/auto/qml/qqmlobjectmodel/tst_qqmlobjectmodel.cpp
index 4cbaa76225..d007f4d024 100644
--- a/tests/auto/qml/qqmlobjectmodel/tst_qqmlobjectmodel.cpp
+++ b/tests/auto/qml/qqmlobjectmodel/tst_qqmlobjectmodel.cpp
@@ -15,7 +15,7 @@ private slots:
static bool compareItems(QQmlObjectModel *model, const QObjectList &items)
{
- for (int i = 0; i < items.count(); ++i) {
+ for (int i = 0; i < items.size(); ++i) {
if (model->get(i) != items.at(i))
return false;
}
diff --git a/tests/auto/qml/qqmlproperty/tst_qqmlproperty.cpp b/tests/auto/qml/qqmlproperty/tst_qqmlproperty.cpp
index 2cb46cc52c..fa89dda0ad 100644
--- a/tests/auto/qml/qqmlproperty/tst_qqmlproperty.cpp
+++ b/tests/auto/qml/qqmlproperty/tst_qqmlproperty.cpp
@@ -2095,7 +2095,7 @@ void tst_qqmlproperty::assignEmptyVariantMap()
QVariantMap map;
map.insert("key", "value");
o.setVariantMap(map);
- QCOMPARE(o.variantMap().count(), 1);
+ QCOMPARE(o.variantMap().size(), 1);
QCOMPARE(o.variantMap().isEmpty(), false);
@@ -2104,7 +2104,7 @@ void tst_qqmlproperty::assignEmptyVariantMap()
component.createWithInitialProperties({{"o", QVariant::fromValue(&o)}}));
QVERIFY(obj);
- QCOMPARE(o.variantMap().count(), 0);
+ QCOMPARE(o.variantMap().size(), 0);
QCOMPARE(o.variantMap().isEmpty(), true);
}
diff --git a/tests/auto/qml/qqmlsqldatabase/tst_qqmlsqldatabase.cpp b/tests/auto/qml/qqmlsqldatabase/tst_qqmlsqldatabase.cpp
index 296b5ef0ff..67c44684a4 100644
--- a/tests/auto/qml/qqmlsqldatabase/tst_qqmlsqldatabase.cpp
+++ b/tests/auto/qml/qqmlsqldatabase/tst_qqmlsqldatabase.cpp
@@ -52,7 +52,7 @@ void removeRecursive(const QString& dirname)
{
QDir dir(dirname);
QFileInfoList entries(dir.entryInfoList(QDir::Dirs|QDir::Files|QDir::NoDotAndDotDot));
- for (int i = 0; i < entries.count(); ++i)
+ for (int i = 0; i < entries.size(); ++i)
if (entries[i].isDir())
removeRecursive(entries[i].filePath());
else
@@ -174,7 +174,7 @@ void tst_qqmlsqldatabase::totalDatabases()
if (engine->offlineStoragePath().isEmpty())
QSKIP("offlineStoragePath is empty, skip this test.");
- QCOMPARE(QDir(dbDir()+"/Databases").entryInfoList(QDir::Files|QDir::NoDotAndDotDot).count(), total_databases_created_by_tests*2);
+ QCOMPARE(QDir(dbDir()+"/Databases").entryInfoList(QDir::Files|QDir::NoDotAndDotDot).size(), total_databases_created_by_tests*2);
}
void tst_qqmlsqldatabase::upgradeDatabase()
diff --git a/tests/auto/qml/qqmlxmllistmodel/tst_qqmlxmllistmodel.cpp b/tests/auto/qml/qqmlxmllistmodel/tst_qqmlxmllistmodel.cpp
index ce30eceb05..05b8ce605d 100644
--- a/tests/auto/qml/qqmlxmllistmodel/tst_qqmlxmllistmodel.cpp
+++ b/tests/auto/qml/qqmlxmllistmodel/tst_qqmlxmllistmodel.cpp
@@ -313,7 +313,7 @@ void tst_QQmlXmlListModel::headers()
QQmlXmlListModel::Ready);
// It doesn't do a network request for a local file
- QCOMPARE(factory.lastSentHeaders.count(), 0);
+ QCOMPARE(factory.lastSentHeaders.size(), 0);
model->setProperty("source", QUrl("http://localhost/filethatdoesnotexist.xml"));
QTRY_COMPARE_WITH_TIMEOUT(qvariant_cast<QQmlXmlListModel::Status>(model->property("status")),
@@ -322,7 +322,7 @@ void tst_QQmlXmlListModel::headers()
QVariantMap expectedHeaders;
expectedHeaders["Accept"] = "application/xml,*/*";
- QCOMPARE(factory.lastSentHeaders.count(), expectedHeaders.count());
+ QCOMPARE(factory.lastSentHeaders.size(), expectedHeaders.size());
for (auto it = expectedHeaders.cbegin(), end = expectedHeaders.cend(); it != end; ++it) {
QVERIFY(factory.lastSentHeaders.contains(it.key()));
QCOMPARE(factory.lastSentHeaders[it.key()].toString(), it.value().toString());
diff --git a/tests/auto/quick/pointerhandlers/qquickpointhandler/tst_qquickpointhandler.cpp b/tests/auto/quick/pointerhandlers/qquickpointhandler/tst_qquickpointhandler.cpp
index 5683261635..70df900540 100644
--- a/tests/auto/quick/pointerhandlers/qquickpointhandler/tst_qquickpointhandler.cpp
+++ b/tests/auto/quick/pointerhandlers/qquickpointhandler/tst_qquickpointhandler.cpp
@@ -204,8 +204,8 @@ void tst_PointHandler::simultaneousMultiTouch()
int i = 0;
for (auto h : handlers) {
QTRY_COMPARE(h->active(), true);
- QCOMPARE(activeSpies[i]->count(), 1);
- QCOMPARE(pointSpies[i]->count(), 1);
+ QCOMPARE(activeSpies[i]->size(), 1);
+ QCOMPARE(pointSpies[i]->size(), 1);
int chosenPointIndex = points.indexOf(h->point().position().toPoint());
QVERIFY(chosenPointIndex != -1);
// Verify that each handler chose a unique point
@@ -215,7 +215,7 @@ void tst_PointHandler::simultaneousMultiTouch()
QCOMPARE(h->point().scenePosition().toPoint(), point);
QCOMPARE(h->point().pressedButtons(), Qt::NoButton);
QCOMPARE(h->translation(), QVector2D());
- QCOMPARE(translationSpies[i]->count(), 1);
+ QCOMPARE(translationSpies[i]->size(), 1);
++i;
}
@@ -226,8 +226,8 @@ void tst_PointHandler::simultaneousMultiTouch()
i = 0;
for (auto h : handlers) {
QCOMPARE(h->active(), true);
- QCOMPARE(activeSpies[i]->count(), 1);
- QCOMPARE(pointSpies[i]->count(), 2);
+ QCOMPARE(activeSpies[i]->size(), 1);
+ QCOMPARE(pointSpies[i]->size(), 2);
QCOMPARE(h->point().position().toPoint(), points[pointIndexPerHandler[i]]);
QCOMPARE(h->point().scenePosition().toPoint(), points[pointIndexPerHandler[i]]);
QCOMPARE(h->point().pressPosition().toPoint(), pressPoints[pointIndexPerHandler[i]]);
@@ -236,7 +236,7 @@ void tst_PointHandler::simultaneousMultiTouch()
QVERIFY(h->point().velocity().x() > 0);
QVERIFY(h->point().velocity().y() > 0);
QCOMPARE(h->translation(), QVector2D(10 + 10 * pointIndexPerHandler[i], 10 + 10 * pointIndexPerHandler[i] % 2));
- QCOMPARE(translationSpies[i]->count(), 2);
+ QCOMPARE(translationSpies[i]->size(), 2);
++i;
}
@@ -245,10 +245,10 @@ void tst_PointHandler::simultaneousMultiTouch()
i = 0;
for (auto h : handlers) {
QTRY_COMPARE(h->active(), false);
- QCOMPARE(activeSpies[i]->count(), 2);
- QCOMPARE(pointSpies[i]->count(), 3);
+ QCOMPARE(activeSpies[i]->size(), 2);
+ QCOMPARE(pointSpies[i]->size(), 3);
QCOMPARE(h->translation(), QVector2D());
- QCOMPARE(translationSpies[i]->count(), 3);
+ QCOMPARE(translationSpies[i]->size(), 3);
++i;
}
diff --git a/tests/auto/quick/qquickaccessible/tst_qquickaccessible.cpp b/tests/auto/quick/qquickaccessible/tst_qquickaccessible.cpp
index fa41dfd3d6..e7da38a5ce 100644
--- a/tests/auto/quick/qquickaccessible/tst_qquickaccessible.cpp
+++ b/tests/auto/quick/qquickaccessible/tst_qquickaccessible.cpp
@@ -98,10 +98,10 @@ void tst_QQuickAccessible::cleanup()
{
const EventList list = QTestAccessibility::events();
if (!list.isEmpty()) {
- qWarning().noquote() << list.count()
+ qWarning().noquote() << list.size()
<< "accessibility event(s) were not handled in testfunction '"
<< QTest::currentTestFunction() << "':";
- for (int i = 0; i < list.count(); ++i) {
+ for (int i = 0; i < list.size(); ++i) {
auto object = list.at(i)->object();
QString objectInfo = object ? QDebug::toString(object)
: u"[deleted object]"_s;
diff --git a/tests/auto/quick/qquickgridview/tst_qquickgridview.cpp b/tests/auto/quick/qquickgridview/tst_qquickgridview.cpp
index e7a2cb2c27..1a2d409473 100644
--- a/tests/auto/quick/qquickgridview/tst_qquickgridview.cpp
+++ b/tests/auto/quick/qquickgridview/tst_qquickgridview.cpp
@@ -3976,7 +3976,7 @@ void tst_QQuickGridView::onAdd()
qApp->processEvents();
QVariantList result = gridview->property("addedDelegates").toList();
- QTRY_COMPARE(result.count(), items.size());
+ QTRY_COMPARE(result.size(), items.size());
for (int i=0; i<items.size(); i++)
QCOMPARE(result[i].toString(), items[i].first);
@@ -5438,15 +5438,15 @@ void tst_QQuickGridView::displacedTransitions()
QTRY_VERIFY(gridview->property("displaceTransitionsDone").toBool());
// check the correct number of target items and indexes were received
- QCOMPARE(resultTargetIndexes.count(), expectedDisplacedIndexes.count());
- for (int i=0; i<resultTargetIndexes.count(); i++)
+ QCOMPARE(resultTargetIndexes.size(), expectedDisplacedIndexes.count());
+ for (int i=0; i<resultTargetIndexes.size(); i++)
QCOMPARE(resultTargetIndexes[i].value<QList<int> >().size(), change.count);
- QCOMPARE(resultTargetItems.count(), expectedDisplacedIndexes.count());
- for (int i=0; i<resultTargetItems.count(); i++)
+ QCOMPARE(resultTargetItems.size(), expectedDisplacedIndexes.count());
+ for (int i=0; i<resultTargetItems.size(); i++)
QCOMPARE(resultTargetItems[i].toList().size(), change.count);
} else {
- QCOMPARE(resultTargetIndexes.count(), 0);
- QCOMPARE(resultTargetItems.count(), 0);
+ QCOMPARE(resultTargetIndexes.size(), 0);
+ QCOMPARE(resultTargetItems.size(), 0);
}
if (change.type == ListChange::Inserted && useAddDisplaced && addDisplacedEnabled)
@@ -6404,7 +6404,7 @@ QList<int> tst_QQuickGridView::toIntList(const QVariantList &list)
{
QList<int> ret;
bool ok = true;
- for (int i=0; i<list.count(); i++) {
+ for (int i=0; i<list.size(); i++) {
ret << list[i].toInt(&ok);
if (!ok)
qWarning() << "tst_QQuickGridView::toIntList(): not a number:" << list[i];
@@ -6416,7 +6416,7 @@ QList<int> tst_QQuickGridView::toIntList(const QVariantList &list)
void tst_QQuickGridView::matchIndexLists(const QVariantList &indexLists, const QList<int> &expectedIndexes)
{
const QSet<int> expectedIndexSet(expectedIndexes.cbegin(), expectedIndexes.cend());
- for (int i=0; i<indexLists.count(); i++) {
+ for (int i=0; i<indexLists.size(); i++) {
const auto &currentList = indexLists[i].value<QList<int> >();
const QSet<int> current(currentList.cbegin(), currentList.cend());
if (current != expectedIndexSet)
@@ -6436,19 +6436,19 @@ void tst_QQuickGridView::matchItemsAndIndexes(const QVariantMap &items, const Qa
qDebug() << itemIndex;
QCOMPARE(model.name(itemIndex), name);
}
- QCOMPARE(items.count(), expectedIndexes.size());
+ QCOMPARE(items.size(), expectedIndexes.size());
}
void tst_QQuickGridView::matchItemLists(const QVariantList &itemLists, const QList<QQuickItem *> &expectedItems)
{
- for (int i=0; i<itemLists.count(); i++) {
+ for (int i=0; i<itemLists.size(); i++) {
QVariantList current = itemLists[i].toList();
- for (int j=0; j<current.count(); j++) {
+ for (int j=0; j<current.size(); j++) {
QQuickItem *o = qobject_cast<QQuickItem*>(current[j].value<QObject*>());
QVERIFY2(o, QTest::toString(QString("Invalid actual item at %1").arg(j)));
QVERIFY2(expectedItems.contains(o), QTest::toString(QString("Cannot match item %1").arg(j)));
}
- QCOMPARE(current.count(), expectedItems.size());
+ QCOMPARE(current.size(), expectedItems.size());
}
}
diff --git a/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp b/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp
index c34d55f87b..bc372fd040 100644
--- a/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp
+++ b/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp
@@ -4913,7 +4913,7 @@ void tst_QQuickListView::onAdd()
QTRY_COMPARE(listview->property("count").toInt(), model.count());
QVariantList result = listview->property("addedDelegates").toList();
- QCOMPARE(result.count(), items.size());
+ QCOMPARE(result.size(), items.size());
for (int i=0; i<items.size(); i++)
QCOMPARE(result[i].toString(), items[i].first);
}
@@ -7528,15 +7528,15 @@ void tst_QQuickListView::displacedTransitions()
QTRY_VERIFY(listview->property("displaceTransitionsDone").toBool());
// check the correct number of target items and indexes were received
- QCOMPARE(resultTargetIndexes.count(), expectedDisplacedIndexes.count());
- for (int i=0; i<resultTargetIndexes.count(); i++)
+ QCOMPARE(resultTargetIndexes.size(), expectedDisplacedIndexes.count());
+ for (int i=0; i<resultTargetIndexes.size(); i++)
QCOMPARE(resultTargetIndexes[i].value<QList<int> >().size(), change.count);
- QCOMPARE(resultTargetItems.count(), expectedDisplacedIndexes.count());
- for (int i=0; i<resultTargetItems.count(); i++)
+ QCOMPARE(resultTargetItems.size(), expectedDisplacedIndexes.count());
+ for (int i=0; i<resultTargetItems.size(); i++)
QCOMPARE(resultTargetItems[i].toList().size(), change.count);
} else {
- QCOMPARE(resultTargetIndexes.count(), 0);
- QCOMPARE(resultTargetItems.count(), 0);
+ QCOMPARE(resultTargetIndexes.size(), 0);
+ QCOMPARE(resultTargetItems.size(), 0);
}
if (change.type == ListChange::Inserted && useAddDisplaced && addDisplacedEnabled)
@@ -7897,7 +7897,7 @@ QList<int> tst_QQuickListView::toIntList(const QVariantList &list)
{
QList<int> ret;
bool ok = true;
- for (int i=0; i<list.count(); i++) {
+ for (int i=0; i<list.size(); i++) {
ret << list[i].toInt(&ok);
if (!ok)
qWarning() << "tst_QQuickListView::toIntList(): not a number:" << list[i];
@@ -7909,7 +7909,7 @@ QList<int> tst_QQuickListView::toIntList(const QVariantList &list)
void tst_QQuickListView::matchIndexLists(const QVariantList &indexLists, const QList<int> &expectedIndexes)
{
const QSet<int> expectedIndexSet(expectedIndexes.cbegin(), expectedIndexes.cend());
- for (int i=0; i<indexLists.count(); i++) {
+ for (int i=0; i<indexLists.size(); i++) {
const auto &currentList = indexLists[i].value<QList<int> >();
const QSet<int> current(currentList.cbegin(), currentList.cend());
if (current != expectedIndexSet)
@@ -7929,20 +7929,20 @@ void tst_QQuickListView::matchItemsAndIndexes(const QVariantMap &items, const Qa
qDebug() << itemIndex;
QCOMPARE(model.name(itemIndex), name);
}
- QCOMPARE(items.count(), expectedIndexes.size());
+ QCOMPARE(items.size(), expectedIndexes.size());
}
void tst_QQuickListView::matchItemLists(const QVariantList &itemLists, const QList<QQuickItem *> &expectedItems)
{
- for (int i=0; i<itemLists.count(); i++) {
+ for (int i=0; i<itemLists.size(); i++) {
QCOMPARE(itemLists[i].typeId(), QMetaType::QVariantList);
QVariantList current = itemLists[i].toList();
- for (int j=0; j<current.count(); j++) {
+ for (int j=0; j<current.size(); j++) {
QQuickItem *o = qobject_cast<QQuickItem*>(current[j].value<QObject*>());
QVERIFY2(o, qPrintable(QString("Invalid actual item at %1").arg(j)));
QVERIFY2(expectedItems.contains(o), qPrintable(QString("Cannot match item %1").arg(j)));
}
- QCOMPARE(current.count(), expectedItems.size());
+ QCOMPARE(current.size(), expectedItems.size());
}
}
diff --git a/tests/auto/quick/qquicklistview2/tst_qquicklistview2.cpp b/tests/auto/quick/qquicklistview2/tst_qquicklistview2.cpp
index aad13f67e9..ce71221969 100644
--- a/tests/auto/quick/qquicklistview2/tst_qquicklistview2.cpp
+++ b/tests/auto/quick/qquicklistview2/tst_qquicklistview2.cpp
@@ -430,7 +430,7 @@ void tst_QQuickListView2::tapDelegateDuringFlicking() // QTBUG-103832
QVERIFY(lastPressed > 5);
QCOMPARE(releasedDelegates.last(), lastPressed);
QCOMPARE(tappedDelegates.last(), lastPressed);
- QCOMPARE(canceledDelegates.count(), 1); // only the first press was canceled, not the second
+ QCOMPARE(canceledDelegates.size(), 1); // only the first press was canceled, not the second
}
void tst_QQuickListView2::flickDuringFlicking_data()
diff --git a/tests/auto/quick/qquickloader/tst_qquickloader.cpp b/tests/auto/quick/qquickloader/tst_qquickloader.cpp
index 4a8db5fd94..5b63841259 100644
--- a/tests/auto/quick/qquickloader/tst_qquickloader.cpp
+++ b/tests/auto/quick/qquickloader/tst_qquickloader.cpp
@@ -466,7 +466,7 @@ void tst_QQuickLoader::networkComponent()
QVERIFY(loader->item());
QCOMPARE(loader->progress(), 1.0);
QCOMPARE(loader->status(), QQuickLoader::Ready);
- QCOMPARE(static_cast<QQuickItem*>(loader)->children().count(), 1);
+ QCOMPARE(static_cast<QQuickItem*>(loader)->children().size(), 1);
}
diff --git a/tests/auto/quick/qquickpositioners/tst_qquickpositioners.cpp b/tests/auto/quick/qquickpositioners/tst_qquickpositioners.cpp
index f7db547393..317694f06c 100644
--- a/tests/auto/quick/qquickpositioners/tst_qquickpositioners.cpp
+++ b/tests/auto/quick/qquickpositioners/tst_qquickpositioners.cpp
@@ -1284,7 +1284,7 @@ void tst_qquickpositioners::moveTransitions(const QString &positionerObjectName)
QCOMPARE(window->rootObject()->property("displacedTrans_targetIndexes").toList(), listOfEmptyIntLists);
QVariantList listOfEmptyObjectLists;
for (int i=0; i<displacedIndexes.size(); i++)
- listOfEmptyObjectLists.insert(listOfEmptyObjectLists.count(), QVariantList());
+ listOfEmptyObjectLists.insert(listOfEmptyObjectLists.size(), QVariantList());
QCOMPARE(window->rootObject()->property("displacedTrans_targetItems").toList(), listOfEmptyObjectLists);
}
@@ -4012,7 +4012,7 @@ QQuickView *tst_qquickpositioners::createView(const QString &filename, bool wait
void tst_qquickpositioners::matchIndexLists(const QVariantList &indexLists, const QList<int> &expectedIndexes)
{
const QSet<int> expectedIndexSet(expectedIndexes.cbegin(), expectedIndexes.cend());
- for (int i=0; i<indexLists.count(); i++) {
+ for (int i=0; i<indexLists.size(); i++) {
const auto &currentList = indexLists[i].value<QList<int> >();
const QSet<int> current(currentList.cbegin(), currentList.cend());
if (current != expectedIndexSet)
@@ -4032,20 +4032,20 @@ void tst_qquickpositioners::matchItemsAndIndexes(const QVariantMap &items, const
qDebug() << itemIndex;
QCOMPARE(model.name(itemIndex), name);
}
- QCOMPARE(items.count(), expectedIndexes.size());
+ QCOMPARE(items.size(), expectedIndexes.size());
}
void tst_qquickpositioners::matchItemLists(const QVariantList &itemLists, const QList<QQuickItem *> &expectedItems)
{
- for (int i=0; i<itemLists.count(); i++) {
+ for (int i=0; i<itemLists.size(); i++) {
QCOMPARE(itemLists[i].typeId(), QMetaType::QVariantList);
QVariantList current = itemLists[i].toList();
- for (int j=0; j<current.count(); j++) {
+ for (int j=0; j<current.size(); j++) {
QQuickItem *o = qobject_cast<QQuickItem*>(current[j].value<QObject*>());
QVERIFY2(o, QTest::toString(QString("Invalid actual item at %1").arg(j)));
QVERIFY2(expectedItems.contains(o), QTest::toString(QString("Cannot match item %1").arg(j)));
}
- QCOMPARE(current.count(), expectedItems.size());
+ QCOMPARE(current.size(), expectedItems.size());
}
}
diff --git a/tests/auto/quick/qquickrectangle/tst_qquickrectangle.cpp b/tests/auto/quick/qquickrectangle/tst_qquickrectangle.cpp
index 36cd23a545..d5520de682 100644
--- a/tests/auto/quick/qquickrectangle/tst_qquickrectangle.cpp
+++ b/tests/auto/quick/qquickrectangle/tst_qquickrectangle.cpp
@@ -75,7 +75,7 @@ void tst_qquickrectangle::gradient()
QCOMPARE(stops.at(&stops, 1)->color(), QColor("white"));
QGradientStops gradientStops = grad->gradientStops();
- QCOMPARE(gradientStops.count(), 2);
+ QCOMPARE(gradientStops.size(), 2);
QCOMPARE(gradientStops.at(0).first, 0.0);
QCOMPARE(gradientStops.at(0).second, QColor("gray"));
QCOMPARE(gradientStops.at(1).first, 1.0);
diff --git a/tests/auto/quick/qquickrepeater/tst_qquickrepeater.cpp b/tests/auto/quick/qquickrepeater/tst_qquickrepeater.cpp
index 8c5959d618..5a6498a5d7 100644
--- a/tests/auto/quick/qquickrepeater/tst_qquickrepeater.cpp
+++ b/tests/auto/quick/qquickrepeater/tst_qquickrepeater.cpp
@@ -166,15 +166,15 @@ void tst_QQuickRepeater::objectList()
QCOMPARE(repeater->property("instantiated").toInt(), 100);
QVERIFY(!repeater->itemAt(-1));
- for (int i=0; i<data.count(); i++)
+ for (int i=0; i<data.size(); i++)
QCOMPARE(repeater->itemAt(i), repeater->parentItem()->childItems().at(i));
- QVERIFY(!repeater->itemAt(data.count()));
+ QVERIFY(!repeater->itemAt(data.size()));
QSignalSpy addedSpy(repeater, SIGNAL(itemAdded(int,QQuickItem*)));
QSignalSpy removedSpy(repeater, SIGNAL(itemRemoved(int,QQuickItem*)));
ctxt->setContextProperty("testData", QVariant::fromValue(data));
- QCOMPARE(addedSpy.size(), data.count());
- QCOMPARE(removedSpy.size(), data.count());
+ QCOMPARE(addedSpy.size(), data.size());
+ QCOMPARE(removedSpy.size(), data.size());
qDeleteAll(data);
delete window;
@@ -805,7 +805,7 @@ void tst_QQuickRepeater::invalidContextCrash()
engine.rootContext()->setContextProperty("badModel", model);
QScopedPointer<QObject> root(component.create());
- QCOMPARE(root->children().count(), 1);
+ QCOMPARE(root->children().size(), 1);
QObject *repeater = root->children().first();
// Make sure the model comes first in the child list, so it will be
@@ -815,7 +815,7 @@ void tst_QQuickRepeater::invalidContextCrash()
repeater->setParent(nullptr);
repeater->setParent(root.data());
- QCOMPARE(root->children().count(), 2);
+ QCOMPARE(root->children().size(), 2);
QCOMPARE(root->children().at(0), model);
QCOMPARE(root->children().at(1), repeater);
diff --git a/tests/auto/quick/qquickstates/tst_qquickstates.cpp b/tests/auto/quick/qquickstates/tst_qquickstates.cpp
index 8cd306fc98..62fca7d280 100644
--- a/tests/auto/quick/qquickstates/tst_qquickstates.cpp
+++ b/tests/auto/quick/qquickstates/tst_qquickstates.cpp
@@ -1483,7 +1483,7 @@ void tst_qquickstates::editProperties()
rectPrivate->setState("");
- QCOMPARE(propertyChangesBlue->actions().length(), 2);
+ QCOMPARE(propertyChangesBlue->actions().size(), 2);
QVERIFY(propertyChangesBlue->containsValue("width"));
QVERIFY(!propertyChangesBlue->containsProperty("x"));
QCOMPARE(propertyChangesBlue->value("width").toInt(), 50);
@@ -1491,20 +1491,20 @@ void tst_qquickstates::editProperties()
propertyChangesBlue->changeValue("width", 60);
QCOMPARE(propertyChangesBlue->value("width").toInt(), 60);
- QCOMPARE(propertyChangesBlue->actions().length(), 2);
+ QCOMPARE(propertyChangesBlue->actions().size(), 2);
propertyChangesBlue->changeExpression("width", "myRectangle.width / 2");
QVERIFY(!propertyChangesBlue->containsValue("width"));
QVERIFY(propertyChangesBlue->containsExpression("width"));
QCOMPARE(propertyChangesBlue->value("width").toInt(), 0);
- QCOMPARE(propertyChangesBlue->actions().length(), 2);
+ QCOMPARE(propertyChangesBlue->actions().size(), 2);
propertyChangesBlue->changeValue("width", 50);
QVERIFY(propertyChangesBlue->containsValue("width"));
QVERIFY(!propertyChangesBlue->containsExpression("width"));
QCOMPARE(propertyChangesBlue->value("width").toInt(), 50);
- QCOMPARE(propertyChangesBlue->actions().length(), 2);
+ QCOMPARE(propertyChangesBlue->actions().size(), 2);
QVERIFY(QQmlAnyBinding::ofProperty(QQmlProperty(childRect, "width")));
rectPrivate->setState("blue");
@@ -1513,7 +1513,7 @@ void tst_qquickstates::editProperties()
propertyChangesBlue->changeValue("width", 60);
QCOMPARE(propertyChangesBlue->value("width").toInt(), 60);
- QCOMPARE(propertyChangesBlue->actions().length(), 2);
+ QCOMPARE(propertyChangesBlue->actions().size(), 2);
QCOMPARE(childRect->width(), qreal(60));
QVERIFY(!QQmlAnyBinding::ofProperty(QQmlProperty(childRect, "width")));
@@ -1521,7 +1521,7 @@ void tst_qquickstates::editProperties()
QVERIFY(!propertyChangesBlue->containsValue("width"));
QVERIFY(propertyChangesBlue->containsExpression("width"));
QCOMPARE(propertyChangesBlue->value("width").toInt(), 0);
- QCOMPARE(propertyChangesBlue->actions().length(), 2);
+ QCOMPARE(propertyChangesBlue->actions().size(), 2);
QVERIFY(QQmlAnyBinding::ofProperty(QQmlProperty(childRect, "width")));
QCOMPARE(childRect->width(), qreal(200));
@@ -1532,13 +1532,13 @@ void tst_qquickstates::editProperties()
QCOMPARE(childRect->width(), qreal(402));
QVERIFY(QQmlAnyBinding::ofProperty(QQmlProperty(childRect, "width")));
- QCOMPARE(propertyChangesGreen->actions().length(), 2);
+ QCOMPARE(propertyChangesGreen->actions().size(), 2);
rectPrivate->setState("green");
QCOMPARE(childRect->width(), qreal(200));
QCOMPARE(childRect->height(), qreal(100));
QVERIFY(QQmlAnyBinding::ofProperty(QQmlProperty(childRect, "width")));
QVERIFY(greenState->bindingInRevertList(childRect, "width"));
- QCOMPARE(propertyChangesGreen->actions().length(), 2);
+ QCOMPARE(propertyChangesGreen->actions().size(), 2);
propertyChangesGreen->removeProperty("height");
diff --git a/tests/auto/quick/qquickstyledtext/tst_qquickstyledtext.cpp b/tests/auto/quick/qquickstyledtext/tst_qquickstyledtext.cpp
index c9dd75e5c3..aebd9990f7 100644
--- a/tests/auto/quick/qquickstyledtext/tst_qquickstyledtext.cpp
+++ b/tests/auto/quick/qquickstyledtext/tst_qquickstyledtext.cpp
@@ -152,8 +152,8 @@ void tst_qquickstyledtext::textOutput()
const QVector<QTextLayout::FormatRange> layoutFormats = layout.formats();
- QCOMPARE(layoutFormats.size(), formats.count());
- for (int i = 0; i < formats.count(); ++i) {
+ QCOMPARE(layoutFormats.size(), formats.size());
+ for (int i = 0; i < formats.size(); ++i) {
QCOMPARE(layoutFormats.at(i).start, formats.at(i).start);
QCOMPARE(layoutFormats.at(i).length, formats.at(i).length);
if (formats.at(i).type & Format::Bold)
@@ -182,8 +182,8 @@ void tst_qquickstyledtext::anchors()
const QVector<QTextLayout::FormatRange> layoutFormats = layout.formats();
- QCOMPARE(layoutFormats.size(), formats.count());
- for (int i = 0; i < formats.count(); ++i) {
+ QCOMPARE(layoutFormats.size(), formats.size());
+ for (int i = 0; i < formats.size(); ++i) {
QCOMPARE(layoutFormats.at(i).start, formats.at(i).start);
QCOMPARE(layoutFormats.at(i).length, formats.at(i).length);
QVERIFY(layoutFormats.at(i).format.isAnchor() == bool(formats.at(i).type & Format::Anchor));
diff --git a/tests/auto/quick/qquicktableview/tst_qquicktableview.cpp b/tests/auto/quick/qquicktableview/tst_qquicktableview.cpp
index 67a77fd621..e0bc0761a9 100644
--- a/tests/auto/quick/qquicktableview/tst_qquicktableview.cpp
+++ b/tests/auto/quick/qquicktableview/tst_qquicktableview.cpp
@@ -4173,7 +4173,7 @@ void tst_QQuickTableView::selectionBehaviorCells()
}
const int expectedCount = (x2 - x1 + 1) * (y2 - y1 + 1);
- const int actualCount = selectionModel.selectedIndexes().count();
+ const int actualCount = selectionModel.selectedIndexes().size();
QCOMPARE(actualCount, expectedCount);
// Wrap the selection
@@ -4186,7 +4186,7 @@ void tst_QQuickTableView::selectionBehaviorCells()
}
}
- const int actualCountAfterWrap = selectionModel.selectedIndexes().count();
+ const int actualCountAfterWrap = selectionModel.selectedIndexes().size();
QCOMPARE(actualCountAfterWrap, expectedCount);
tableViewPrivate->clearSelection();
@@ -4217,7 +4217,7 @@ void tst_QQuickTableView::selectionBehaviorRows()
QCOMPARE(selectionModel.hasSelection(), true);
const int expectedCount = 10 * 3; // all columns * three rows
- int actualCount = selectionModel.selectedIndexes().count();
+ int actualCount = selectionModel.selectedIndexes().size();
QCOMPARE(actualCount, expectedCount);
for (int x = 0; x < tableView->columns(); ++x) {
@@ -4236,7 +4236,7 @@ void tst_QQuickTableView::selectionBehaviorRows()
QCOMPARE(selectionModel.hasSelection(), true);
- actualCount = selectionModel.selectedIndexes().count();
+ actualCount = selectionModel.selectedIndexes().size();
QCOMPARE(actualCount, expectedCount);
for (int x = 0; x < tableView->columns(); ++x) {
@@ -4271,7 +4271,7 @@ void tst_QQuickTableView::selectionBehaviorColumns()
QCOMPARE(selectionModel.hasSelection(), true);
const int expectedCount = 10 * 3; // all rows * three columns
- int actualCount = selectionModel.selectedIndexes().count();
+ int actualCount = selectionModel.selectedIndexes().size();
QCOMPARE(actualCount, expectedCount);
for (int x = 0; x < 3; ++x) {
@@ -4290,7 +4290,7 @@ void tst_QQuickTableView::selectionBehaviorColumns()
QCOMPARE(selectionModel.hasSelection(), true);
- actualCount = selectionModel.selectedIndexes().count();
+ actualCount = selectionModel.selectedIndexes().size();
QCOMPARE(actualCount, expectedCount);
for (int x = 0; x < 3; ++x) {
@@ -4468,7 +4468,7 @@ void tst_QQuickTableView::clearSelectionOnTap()
// Select root item
const auto index = tableView->selectionModel()->model()->index(0, 0);
tableView->selectionModel()->select(index, QItemSelectionModel::Select);
- QCOMPARE(tableView->selectionModel()->selectedIndexes().count(), 1);
+ QCOMPARE(tableView->selectionModel()->selectedIndexes().size(), 1);
// Click on a cell. This should remove the selection
const auto item = tableView->itemAtCell(0, 0);
@@ -4476,7 +4476,7 @@ void tst_QQuickTableView::clearSelectionOnTap()
QPoint localPos = QPoint(item->width() / 2, item->height() / 2);
QPoint pos = item->window()->contentItem()->mapFromItem(item, localPos).toPoint();
QTest::mouseClick(item->window(), Qt::LeftButton, Qt::NoModifier, pos);
- QCOMPARE(tableView->selectionModel()->selectedIndexes().count(), 0);
+ QCOMPARE(tableView->selectionModel()->selectedIndexes().size(), 0);
}
void tst_QQuickTableView::moveCurrentIndexUsingArrowKeys()
diff --git a/tests/auto/quick/qquicktext/tst_qquicktext.cpp b/tests/auto/quick/qquicktext/tst_qquicktext.cpp
index 475ae92f48..90057e9bf8 100644
--- a/tests/auto/quick/qquicktext/tst_qquicktext.cpp
+++ b/tests/auto/quick/qquicktext/tst_qquicktext.cpp
@@ -2075,7 +2075,7 @@ void tst_qquicktext::linkInteraction()
QObject::connect(textObject, SIGNAL(linkActivated(QString)), &test, SLOT(linkClicked(QString)));
QObject::connect(textObject, SIGNAL(linkHovered(QString)), &test, SLOT(linkHovered(QString)));
- QVERIFY(mousePositions.count() > 0);
+ QVERIFY(mousePositions.size() > 0);
QPointF mousePosition = mousePositions.first();
auto globalPos = textObject->mapToGlobal(mousePosition);
@@ -2091,7 +2091,7 @@ void tst_qquicktext::linkInteraction()
QCOMPARE(textObject->hoveredLink(), hoverEnterLink);
QCOMPARE(textObject->linkAt(mousePosition.x(), mousePosition.y()), hoverEnterLink);
- for (int i = 1; i < mousePositions.count(); ++i) {
+ for (int i = 1; i < mousePositions.size(); ++i) {
mousePosition = mousePositions.at(i);
auto globalPos = textObject->mapToGlobal(mousePosition);
diff --git a/tests/auto/quick/qquicktreeview/tst_qquicktreeview.cpp b/tests/auto/quick/qquicktreeview/tst_qquicktreeview.cpp
index 9b34011c2e..069e49ff23 100644
--- a/tests/auto/quick/qquicktreeview/tst_qquicktreeview.cpp
+++ b/tests/auto/quick/qquicktreeview/tst_qquicktreeview.cpp
@@ -843,7 +843,7 @@ void tst_qquicktreeview::selectionBehaviorCells()
}
const int expectedCount = (x2 - x1 + 1) * (y2 - y1 + 1);
- const int actualCount = selectionModel->selectedIndexes().count();
+ const int actualCount = selectionModel->selectedIndexes().size();
QCOMPARE(actualCount, expectedCount);
// Wrap the selection
@@ -856,7 +856,7 @@ void tst_qquicktreeview::selectionBehaviorCells()
}
}
- const int actualCountAfterWrap = selectionModel->selectedIndexes().count();
+ const int actualCountAfterWrap = selectionModel->selectedIndexes().size();
QCOMPARE(actualCountAfterWrap, expectedCount);
treeViewPrivate->clearSelection();
@@ -885,7 +885,7 @@ void tst_qquicktreeview::selectionBehaviorRows()
QCOMPARE(selectionModel->hasSelection(), true);
const int expectedCount = treeView->columns() * 3; // all columns * three rows
- int actualCount = selectionModel->selectedIndexes().count();
+ int actualCount = selectionModel->selectedIndexes().size();
QCOMPARE(actualCount, expectedCount);
for (int x = 0; x < treeView->columns(); ++x) {
@@ -904,7 +904,7 @@ void tst_qquicktreeview::selectionBehaviorRows()
QCOMPARE(selectionModel->hasSelection(), true);
- actualCount = selectionModel->selectedIndexes().count();
+ actualCount = selectionModel->selectedIndexes().size();
QCOMPARE(actualCount, expectedCount);
for (int x = 0; x < treeView->columns(); ++x) {
@@ -936,7 +936,7 @@ void tst_qquicktreeview::selectionBehaviorColumns()
QCOMPARE(selectionModel->hasSelection(), true);
const int expectedCount = treeView->rows() * 3; // all rows * three columns
- int actualCount = selectionModel->selectedIndexes().count();
+ int actualCount = selectionModel->selectedIndexes().size();
QCOMPARE(actualCount, expectedCount);
for (int x = 0; x < 3; ++x) {
@@ -955,7 +955,7 @@ void tst_qquicktreeview::selectionBehaviorColumns()
QCOMPARE(selectionModel->hasSelection(), true);
- actualCount = selectionModel->selectedIndexes().count();
+ actualCount = selectionModel->selectedIndexes().size();
QCOMPARE(actualCount, expectedCount);
for (int x = 0; x < 3; ++x) {
diff --git a/tests/auto/quick/qquickview_extra/tst_qquickview_extra.cpp b/tests/auto/quick/qquickview_extra/tst_qquickview_extra.cpp
index 114b97779a..0cd4b69e00 100644
--- a/tests/auto/quick/qquickview_extra/tst_qquickview_extra.cpp
+++ b/tests/auto/quick/qquickview_extra/tst_qquickview_extra.cpp
@@ -44,7 +44,7 @@ void tst_QQuickViewExtra::qtbug_87228()
// for the sake of this test, any child would be suitable, so pick first
deletionSpy.reset(new QSignalSpy(children[0], SIGNAL(destroyed(QObject *))));
}
- QCOMPARE(deletionSpy->count(), 1);
+ QCOMPARE(deletionSpy->size(), 1);
}
QTEST_APPLESS_MAIN(tst_QQuickViewExtra)
diff --git a/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp b/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp
index 844979533f..708690d797 100644
--- a/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp
+++ b/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp
@@ -3332,12 +3332,12 @@ private:
static void appendEvent(QQuickItem *filter, QQuickItem *receiver, QEvent *event) {
if (includedEventTypes().contains(event->type())) {
auto record = DeliveryRecord(filter ? filter->objectName() : QString(), receiver ? receiver->objectName() : QString());
- int i = m_deliveryList.count();
- if (m_expectedDeliveryList.count() > i && m_expectedDeliveryList[i] == record)
+ int i = m_deliveryList.size();
+ if (m_expectedDeliveryList.size() > i && m_expectedDeliveryList[i] == record)
qCDebug(lcTests).noquote().nospace() << i << ": " << record;
else
qCDebug(lcTests).noquote().nospace() << i << ": " << record
- << ", expected " << (m_expectedDeliveryList.count() > i ? m_expectedDeliveryList[i].toString() : QLatin1String("nothing")) << " <---";
+ << ", expected " << (m_expectedDeliveryList.size() > i ? m_expectedDeliveryList[i].toString() : QLatin1String("nothing")) << " <---";
m_deliveryList << record;
}
}
@@ -3577,7 +3577,7 @@ void tst_qquickwindow::testChildMouseEventFilter()
if (rootFilter->events.contains(QEvent::MouseButtonPress))
actualDeliveryOrder.append(DeliveryRecord("root"));
- for (int i = 0; i < qMax(actualDeliveryOrder.count(), expectedDeliveryOrder.count()); ++i) {
+ for (int i = 0; i < qMax(actualDeliveryOrder.size(), expectedDeliveryOrder.size()); ++i) {
const DeliveryRecord expectedNames = expectedDeliveryOrder.value(i);
const DeliveryRecord actualNames = actualDeliveryOrder.value(i);
QCOMPARE(actualNames.toString(), expectedNames.toString());
diff --git a/tests/auto/quickcontrols2/qquicktreeviewdelegate/tst_qquicktreeviewdelegate.cpp b/tests/auto/quickcontrols2/qquicktreeviewdelegate/tst_qquicktreeviewdelegate.cpp
index 1420a0e6a8..834729e133 100644
--- a/tests/auto/quickcontrols2/qquicktreeviewdelegate/tst_qquicktreeviewdelegate.cpp
+++ b/tests/auto/quickcontrols2/qquicktreeviewdelegate/tst_qquicktreeviewdelegate.cpp
@@ -316,7 +316,7 @@ void tst_qquicktreeviewdelegate::clearSelectionOnClick()
// Select root item
const auto index = treeView->selectionModel()->model()->index(0, 0);
treeView->selectionModel()->select(index, QItemSelectionModel::Select);
- QCOMPARE(treeView->selectionModel()->selectedIndexes().count(), 1);
+ QCOMPARE(treeView->selectionModel()->selectedIndexes().size(), 1);
// Click on a cell. This should remove the selection
const auto item = qobject_cast<QQuickTreeViewDelegate *>(treeView->itemAtCell(0, 0));
@@ -324,7 +324,7 @@ void tst_qquicktreeviewdelegate::clearSelectionOnClick()
QPoint localPos = QPoint(item->width() / 2, item->height() / 2);
QPoint pos = item->window()->contentItem()->mapFromItem(item, localPos).toPoint();
QTest::mouseClick(item->window(), Qt::LeftButton, Qt::NoModifier, pos);
- QCOMPARE(treeView->selectionModel()->selectedIndexes().count(), 0);
+ QCOMPARE(treeView->selectionModel()->selectedIndexes().size(), 0);
}
void tst_qquicktreeviewdelegate::dragToSelect()
@@ -361,7 +361,7 @@ void tst_qquicktreeviewdelegate::dragToSelect()
// Since TreeView uses TableView.SelectRows by default, we
// now expect cells from 0,0 and 1,1 to be selected.
- QCOMPARE(treeView->selectionModel()->selectedIndexes().count(), 4);
+ QCOMPARE(treeView->selectionModel()->selectedIndexes().size(), 4);
}
void tst_qquicktreeviewdelegate::pressAndHoldToSelect()
@@ -392,7 +392,7 @@ void tst_qquicktreeviewdelegate::pressAndHoldToSelect()
QTRY_VERIFY(treeView->selectionModel()->hasSelection());
// Since TreeView uses TableView.SelectRows by default, we
// now expect both cell 0,0 and 1,0 to be selected.
- QCOMPARE(treeView->selectionModel()->selectedIndexes().count(), 2);
+ QCOMPARE(treeView->selectionModel()->selectedIndexes().size(), 2);
QTest::mouseRelease(window, Qt::LeftButton, Qt::NoModifier, windowPos0_0);
}
diff --git a/tests/benchmarks/qml/compilation/tst_compilation.cpp b/tests/benchmarks/qml/compilation/tst_compilation.cpp
index 4109bfe730..47e1423dae 100644
--- a/tests/benchmarks/qml/compilation/tst_compilation.cpp
+++ b/tests/benchmarks/qml/compilation/tst_compilation.cpp
@@ -157,7 +157,7 @@ void tst_compilation::bigimport()
QQmlComponent c(&e, p);
QCOMPARE(c.status(), QQmlComponent::Ready);
QScopedPointer<QObject> o(c.create());
- QVERIFY(o->children().count() == filesToCreate);
+ QVERIFY(o->children().size() == filesToCreate);
}
}
diff --git a/tests/benchmarks/quickcontrols2/objectcount/tst_objectcount.cpp b/tests/benchmarks/quickcontrols2/objectcount/tst_objectcount.cpp
index 3bf1cb0802..e1d37eec8f 100644
--- a/tests/benchmarks/quickcontrols2/objectcount/tst_objectcount.cpp
+++ b/tests/benchmarks/quickcontrols2/objectcount/tst_objectcount.cpp
@@ -99,7 +99,7 @@ static void doBenchmark(QQmlEngine *engine, const QUrl &url)
qInfo() << "\t" << object;
}
- QTest::setBenchmarkResult(objects.count(), QTest::Events);
+ QTest::setBenchmarkResult(objects.size(), QTest::Events);
}
void tst_ObjectCount::qobjects()