diff options
author | Semih Yavuz <semih.yavuz@qt.io> | 2022-12-02 22:07:12 +0100 |
---|---|---|
committer | Semih Yavuz <semih.yavuz@qt.io> | 2022-12-05 17:39:24 +0100 |
commit | 9793c663ccd1fbcbbe56f9dcab1515909113d704 (patch) | |
tree | 517db468d1520f078268eeda35abc76817595c68 /src/qml/qml/qqml.cpp | |
parent | 4f92f018ea0639b8127ad25f4430e5a5ee4e61a1 (diff) |
Fix comparison AOT-lookup and intended type in value types
We currently force the lookup metatype to be exactly the same data type
with the caller's. As a result, the conversion from enum to integral
data type is not recognized. Relax this comparison by using
isTypeCompatible helper.
Pick-to: 6.4
Fixes: QTBUG-109007
Change-Id: I188dc3e6c1fd7100e9ed5c4ba5d0c90d85d79be4
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src/qml/qml/qqml.cpp')
-rw-r--r-- | src/qml/qml/qqml.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/qml/qml/qqml.cpp b/src/qml/qml/qqml.cpp index db36cf6655..3eebbb6df7 100644 --- a/src/qml/qml/qqml.cpp +++ b/src/qml/qml/qqml.cpp @@ -1047,7 +1047,7 @@ static bool initValueLookup(QV4::Lookup *l, QV4::ExecutableCompilationUnit *comp const QByteArray name = compilationUnit->runtimeStrings[l->nameIndex]->toQString().toUtf8(); const int coreIndex = metaObject->indexOfProperty(name.constData()); QMetaType lookupType = metaObject->property(coreIndex).metaType(); - if (type.isValid() && lookupType != type) + if (!isTypeCompatible(type, lookupType)) return false; l->qgadgetLookup.metaObject = quintptr(metaObject) + 1; l->qgadgetLookup.coreIndex = coreIndex; |