aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2022-05-19 15:50:31 +0200
committerUlf Hermann <ulf.hermann@qt.io>2022-05-24 15:44:16 +0200
commita75ddda71b9a1af2fccad85aca725798eb8aa8e4 (patch)
tree93dbfda1de45d147d2bee2c23ff024ce781664a0 /tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp
parentdc77f7c71c532a1c51f7618765559937fd5d2eb3 (diff)
QmlCompiler: Implement LoadElement for value type lists
Instead of the storedType hack in the type resolver, properly declare the type LoadElement can return: A merge of undefined and the actual type. This way we can choose the best concrete type to use for this independently (and optimize it later). Task-number: QTBUG-103529 Change-Id: I17b1f835f6a893ec843a90491e92f72ecb2e87fe Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp')
-rw-r--r--tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp b/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp
index 1ccbd81745..b4993d1752 100644
--- a/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp
+++ b/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp
@@ -937,6 +937,9 @@ void tst_QmlCppCodegen::outOfBoundsArray()
QVERIFY(!object.isNull());
QVERIFY(object->metaObject()->indexOfProperty("oob") > 0);
QVERIFY(!object->property("oob").isValid());
+ const QVariant oob2 = object->property("oob2");
+ QCOMPARE(oob2.metaType(), QMetaType::fromType<QObject *>());
+ QCOMPARE(oob2.value<QObject *>(), nullptr);
}
void tst_QmlCppCodegen::compositeSingleton()
@@ -1948,6 +1951,10 @@ void tst_QmlCppCodegen::typedArray()
QCOMPARE(values6.count(&values6), 3);
for (int i = 0; i < 3; ++i)
QCOMPARE(values6.at(&values6, i), o.data());
+
+ QCOMPARE(o->property("inIntList").toInt(), 2);
+ QCOMPARE(qvariant_cast<QDateTime>(o->property("inDateList")), date);
+ QCOMPARE(o->property("inRealList").toDouble(), 30.0);
}
void tst_QmlCppCodegen::prefixedType()