diff options
| author | Ulf Hermann <ulf.hermann@qt.io> | 2023-07-26 10:49:39 +0200 |
|---|---|---|
| committer | Ulf Hermann <ulf.hermann@qt.io> | 2023-07-26 16:54:52 +0000 |
| commit | 81bab13560572ffd50153a9cab918063d3305cdd (patch) | |
| tree | 26dae9890c46752e5a468b0d23dee513500efbf9 /tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp | |
| parent | 442eeba6724b2b9044822f2d4a54a81b2d6979f6 (diff) | |
QmlCompiler: Force QObject* for LoadElement on list properties
In the presence of incomplete type information we may otherwise conclude
that the value type is QJSValue and generate broken code.
Pick-to: 6.6 6.5 6.2
Change-Id: I533f704a422d0efe8b7b5bb0a170966e9f290b1f
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.cpp | 11 |
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 54b5221e5d..67d55015d2 100644 --- a/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp +++ b/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp @@ -125,6 +125,7 @@ private slots: void listConversion(); void listIndices(); void listLength(); + void listOfInvisible(); void listPropertyAsModel(); void lotsOfRegisters(); void math(); @@ -2418,6 +2419,16 @@ void tst_QmlCppCodegen::listLength() QCOMPARE(object->property("l").toInt(), 2); } +void tst_QmlCppCodegen::listOfInvisible() +{ + QQmlEngine engine; + QQmlComponent component(&engine, QUrl(u"qrc:/qt/qml/TestTypes/listOfInvisible.qml"_s)); + QVERIFY2(component.isReady(), component.errorString().toUtf8()); + QScopedPointer<QObject> object(component.create()); + QVERIFY(!object.isNull()); + QCOMPARE(object->property("width").toDouble(), 27.0); +} + void tst_QmlCppCodegen::listPropertyAsModel() { QQmlEngine engine; |
