diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2020-09-07 16:01:30 +0200 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2020-09-15 13:32:47 +0200 |
commit | 98a31ff6b9673b020a688d7d035f03a6497a6f5f (patch) | |
tree | 110e6c3d8e1880b99b4624d678828b930988e406 /src/qml/jsruntime/qv4qobjectwrapper.cpp | |
parent | 62b94166cc99dd5fb663c76cfa38e9e888baae59 (diff) |
Adapt to changes in qtbase
Due to qiterable.h specializing a template declared in qmetatype.h we
temporarily need to include it in a few tests so that the iterables
work.
Change-Id: Ia32392419dead76eaf2b91b2ec4157b726d8de74
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4qobjectwrapper.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4qobjectwrapper.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/qml/jsruntime/qv4qobjectwrapper.cpp b/src/qml/jsruntime/qv4qobjectwrapper.cpp index edd323286a..95672a8635 100644 --- a/src/qml/jsruntime/qv4qobjectwrapper.cpp +++ b/src/qml/jsruntime/qv4qobjectwrapper.cpp @@ -1912,7 +1912,7 @@ bool CallArgument::fromValue(int callType, QV4::ExecutionEngine *engine, const Q #endif } #endif - } else if (QMetaType::typeFlags(callType) + } else if (QMetaType(callType).flags() & (QMetaType::PointerToQObject | QMetaType::PointerToGadget)) { // You can assign null or undefined to any pointer. The result is a nullptr. if (value.isNull() || value.isUndefined()) { @@ -1932,11 +1932,12 @@ bool CallArgument::fromValue(int callType, QV4::ExecutionEngine *engine, const Q QQmlEnginePrivate *ep = engine->qmlEngine() ? QQmlEnginePrivate::get(engine->qmlEngine()) : nullptr; QVariant v = scope.engine->toVariant(value, callType); - if (v.userType() == callType) { + const QMetaType callMetaType(callType); + if (v.metaType() == callMetaType) { *qvariantPtr = v; - } else if (v.canConvert(callType)) { + } else if (v.canConvert(callMetaType)) { *qvariantPtr = v; - qvariantPtr->convert(callType); + qvariantPtr->convert(callMetaType); } else { QQmlMetaObject mo = ep ? ep->rawMetaObjectForType(callType) : QQmlMetaObject(); if (!mo.isNull()) { |