diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2022-07-04 17:00:15 +0200 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2022-07-07 19:33:27 +0200 |
commit | 3f3e961a5afe2e62f436f946c521ea4afab76dde (patch) | |
tree | 5025c3528580da614d1298d5bf594356d345a860 /src/qml/qml/qqml.cpp | |
parent | 0e48d9d9387aeb39c8289f61f75d9c6fcd6c753f (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.cpp | 3 |
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; } |