aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2022-07-04 17:00:15 +0200
committerUlf Hermann <ulf.hermann@qt.io>2022-07-07 19:33:27 +0200
commit3f3e961a5afe2e62f436f946c521ea4afab76dde (patch)
tree5025c3528580da614d1298d5bf594356d345a860 /tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp
parent0e48d9d9387aeb39c8289f61f75d9c6fcd6c753f (diff)
QmlCompiler: Allow wrapping enums into int
This is what we do internally in the QML engine. Pick-to: 6.4 Fixes: QTBUG-104683 Change-Id: I2f8712cb2cdc56b6c483500627fd8a218edbad81 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.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 f96efacd3f..6d397f2060 100644
--- a/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp
+++ b/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp
@@ -130,6 +130,7 @@ private slots:
void registerPropagation();
void argumentConversion();
void badSequence();
+ void enumLookup();
};
void tst_QmlCppCodegen::simpleBinding()
@@ -2402,6 +2403,16 @@ void tst_QmlCppCodegen::badSequence()
QCOMPARE(self->barzles(), barzles);
}
+void tst_QmlCppCodegen::enumLookup()
+{
+ QQmlEngine engine;
+ QQmlComponent c(&engine, QUrl(u"qrc:/qt/qml/TestTypes/enumLookup.qml"_s));
+ QVERIFY2(c.isReady(), qPrintable(c.errorString()));
+ QScopedPointer<QObject> o(c.create());
+
+ QCOMPARE(o->property("ready").toBool(), true);
+}
+
void tst_QmlCppCodegen::runInterpreted()
{
#ifdef Q_OS_ANDROID