aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2025-04-11 17:00:52 +0200
committerUlf Hermann <ulf.hermann@qt.io>2025-04-14 11:29:35 +0200
commit0bd329a0b42b4c8c3bf77c201f3d8b187467ef02 (patch)
tree347d1d5f18796e4df51a33bba9c4cf37605778b4 /tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp
parentec9dac6eca5ca0c1098b9f48a1b7793b492e6828 (diff)
QmlCompiler: Error out on unstorable types
We already do this for return types, but it's fatal on any type. Pick-to: 6.9 Fixes: QTBUG-135342 Change-Id: I7aee2a19ffcd39d2707eceb34b5073057d8b5ebb Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
Diffstat (limited to 'tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp')
-rw-r--r--tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp b/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp
index e2c353fb60..b2bc02399f 100644
--- a/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp
+++ b/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp
@@ -270,6 +270,7 @@ private slots:
void undefinedToDouble();
void unknownAttached();
void unknownParameter();
+ void unknownUnderlyingType();
void unstoredUndefined();
void unusedAttached();
void urlString();
@@ -5513,6 +5514,16 @@ void tst_QmlCppCodegen::unknownParameter()
QCOMPARE(object->property("cppProp").toInt(), 18);
}
+void tst_QmlCppCodegen::unknownUnderlyingType()
+{
+ QQmlEngine engine;
+ QQmlComponent component(&engine, QUrl(u"qrc:/qt/qml/TestTypes/unknownUnderlyingType.qml"_s));
+ QVERIFY2(!component.isError(), component.errorString().toUtf8());
+ QScopedPointer<QObject> object(component.create());
+ QVERIFY(!object.isNull());
+ QCOMPARE(object->property("foo").toInt(), 11);
+}
+
void tst_QmlCppCodegen::unstoredUndefined()
{
QQmlEngine engine;