aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qmlcppcodegen
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2023-12-04 14:05:12 +0100
committerUlf Hermann <ulf.hermann@qt.io>2023-12-05 12:50:59 +0100
commit6b39eb9be221b988b36fb0db15a896c4bc40cf52 (patch)
treea1df061b2b0621a7d5989a229d8a19d6447d5601 /tests/auto/qml/qmlcppcodegen
parent2ba700577229b6b5ed647ddbdc17a6583f2580a8 (diff)
QML: Use actual type for aliases of enum values
The metatype system and the compiler may disagree about the underlying type. It's generally better to pass the full type information. We can deal with it everywhere by now. Amends commit 3ea55bf398412d373daab9c92b1498f45de70e96 Pick-to: 6.6 Fixes: QTBUG-119531 Change-Id: I4744f5fb81fb5430ac040ec5877f7d0845a2ab12 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'tests/auto/qml/qmlcppcodegen')
-rw-r--r--tests/auto/qml/qmlcppcodegen/data/enumConversion.qml5
-rw-r--r--tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp1
2 files changed, 6 insertions, 0 deletions
diff --git a/tests/auto/qml/qmlcppcodegen/data/enumConversion.qml b/tests/auto/qml/qmlcppcodegen/data/enumConversion.qml
index fee2c50e15..61ddd2162d 100644
--- a/tests/auto/qml/qmlcppcodegen/data/enumConversion.qml
+++ b/tests/auto/qml/qmlcppcodegen/data/enumConversion.qml
@@ -1,7 +1,12 @@
+pragma Strict
import TestTypes
MyType {
id: root
+
+ property alias status: root.a
+
property int test: myEnumType.type
property bool test_1: myEnumType.type
+ objectName: root.status + "m"
}
diff --git a/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp b/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp
index 51f797b05b..70a064cb83 100644
--- a/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp
+++ b/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp
@@ -1452,6 +1452,7 @@ void tst_QmlCppCodegen::enumConversion()
QVERIFY(o);
QCOMPARE(o->property("test").toInt(), 0x04);
QCOMPARE(o->property("test_1").toBool(), true);
+ QCOMPARE(o->objectName(), u"0m"_s);
}
void tst_QmlCppCodegen::enumFromBadSingleton()