diff options
author | David Skoland <david.skoland@qt.io> | 2020-11-02 11:09:38 +0100 |
---|---|---|
committer | David Skoland <david.skoland@qt.io> | 2020-11-02 14:56:00 +0100 |
commit | e47edfe7a75eb9240604e66fc6a400ebef83b6a0 (patch) | |
tree | dfb655d9c2872bb2dbe3575a3a1d74aa1a8f47c8 /tests/auto/qml/qqmllistmodel/tst_qqmllistmodel.cpp | |
parent | 50ba4ffdf48461d38f4dd2137a0fbbc916c9eb0a (diff) |
Update tests to use new metaType system
Change from the QVariant enum to the QMetaType enum and prefer typeId
over userType where possible
Change-Id: Ic89c55978d46cc23d23b8e9c82c475c0c220fae3
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'tests/auto/qml/qqmllistmodel/tst_qqmllistmodel.cpp')
-rw-r--r-- | tests/auto/qml/qqmllistmodel/tst_qqmllistmodel.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/auto/qml/qqmllistmodel/tst_qqmllistmodel.cpp b/tests/auto/qml/qqmllistmodel/tst_qqmllistmodel.cpp index d54e3467b7..c2f9cfbc11 100644 --- a/tests/auto/qml/qqmllistmodel/tst_qqmllistmodel.cpp +++ b/tests/auto/qml/qqmllistmodel/tst_qqmllistmodel.cpp @@ -145,7 +145,7 @@ bool tst_qqmllistmodel::compareVariantList(const QVariantList &testList, QVarian for (int i=0 ; i < testList.count() ; ++i) { const QVariant &testVariant = testList.at(i); - if (testVariant.type() != QVariant::Map) + if (testVariant.typeId() != QMetaType::QVariantMap) return false; const QVariantMap &map = testVariant.toMap(); @@ -164,7 +164,7 @@ bool tst_qqmllistmodel::compareVariantList(const QVariantList &testList, QVarian const QVariant &modelData = model->data(i, roleIndex); - if (testData.type() == QVariant::List) { + if (testData.typeId() == QMetaType::QVariantList) { const QVariantList &subList = testData.toList(); allOk = allOk && compareVariantList(subList, modelData); } else { @@ -421,7 +421,7 @@ void tst_qqmllistmodel::static_nestedElements() QVERIFY(obj != nullptr); QVariant count = obj->property("count"); - QCOMPARE(count.type(), QVariant::Int); + QCOMPARE(count.typeId(), QMetaType::Int); QCOMPARE(count.toInt(), elementCount); delete obj; @@ -809,7 +809,7 @@ void tst_qqmllistmodel::get() int role = roleFromName(model, roleName); QVERIFY(role >= 0); - if (roleValue.type() == QVariant::List) { + if (roleValue.typeId() == QMetaType::QVariantList) { const QVariantList &list = roleValue.toList(); QVERIFY(compareVariantList(list, model->data(index, role))); } else { @@ -861,7 +861,7 @@ void tst_qqmllistmodel::get_nested() QFETCH(QVariant, roleValue); QFETCH(bool, dynamicRoles); - if (roleValue.type() == QVariant::Map) + if (roleValue.typeId() == QMetaType::QVariantMap) return; QQmlEngine engine; @@ -935,7 +935,7 @@ void tst_qqmllistmodel::get_nested() int role = roleFromName(childModel, roleName); QVERIFY(role >= 0); - if (roleValue.type() == QVariant::List) { + if (roleValue.typeId() == QMetaType::QVariantList) { QVERIFY(compareVariantList(roleValue.toList(), childModel->data(index, role))); } else { QCOMPARE(childModel->data(index, role), roleValue); |