aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqml.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 /src/qml/qml/qqml.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 'src/qml/qml/qqml.cpp')
-rw-r--r--src/qml/qml/qqml.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/qml/qml/qqml.cpp b/src/qml/qml/qqml.cpp
index cb5157a6e1..0fd0f9b5cd 100644
--- a/src/qml/qml/qqml.cpp
+++ b/src/qml/qml/qqml.cpp
@@ -921,6 +921,9 @@ static bool isTypeCompatible(QMetaType lookupType, QMetaType propertyType)
if (!foundMetaObject)
return false;
+ } else if (lookupType == QMetaType::fromType<int>()
+ && propertyType.flags() & QMetaType::IsEnumeration) {
+ return true;
} else if (propertyType != lookupType) {
return false;
}