diff options
| author | Ulf Hermann <ulf.hermann@qt.io> | 2023-11-17 10:30:34 +0100 |
|---|---|---|
| committer | Ulf Hermann <ulf.hermann@qt.io> | 2023-11-18 08:36:01 +0100 |
| commit | 73f66c8f9409eb2b6e5281dd1fd3fec1b063e2c6 (patch) | |
| tree | bf750d49806e9805d29be4155a0387420e12458d /tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp | |
| parent | 8190f5bd68ff8acce33b2983e43f9bb5f9abec75 (diff) | |
QmlCompiler: Do not generate lookups for bare meta enums
Such code is necessarily dead or uncompilable.
Pick-to: 6.6 6.5 6.2
Fixes: QTBUG-119090
Change-Id: I7319f7ceeb0b4994d5e974bbe8a9c3ba3bf72fc5
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 | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp b/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp index 5d44b84475..c1977717a8 100644 --- a/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp +++ b/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp @@ -191,6 +191,7 @@ private slots: void signatureIgnored(); void simpleBinding(); void storeElementSideEffects(); + void storeMetaEnum(); void stringArg(); void stringLength(); void stringToByteArray(); @@ -3913,6 +3914,20 @@ void tst_QmlCppCodegen::storeElementSideEffects() QCOMPARE(prop.property(0).toInt(), 10); } +void tst_QmlCppCodegen::storeMetaEnum() +{ + QQmlEngine engine; + + QQmlComponent c(&engine, QUrl(u"qrc:/qt/qml/TestTypes/StoreMetaEnum.qml"_s)); + QVERIFY2(c.isReady(), qPrintable(c.errorString())); + + QScopedPointer<QObject> o(c.create()); + QVERIFY(o); + + QCOMPARE(o->property("bar").toInt(), 0); + QCOMPARE(o->property("baz").toInt(), 1); +} + void tst_QmlCppCodegen::stringArg() { QQmlEngine engine; |
