From d009c0088bac6da4d775345a60e33fee22af22ce Mon Sep 17 00:00:00 2001 From: Fabian Kosmale Date: Wed, 24 Mar 2021 15:36:37 +0100 Subject: QV4::Engine::toVariant: Use metatype instead of metatype id This way, we can avoid the costly id to metatype lookup in case where we actually need the full metatype. Task-number: QTBUG-88766 Change-Id: Ibe29b323007f00d2f8d1807fb9b64f9a8f87e807 Reviewed-by: Ulf Hermann Reviewed-by: Andrei Golubev --- src/qml/jsruntime/qv4jscall_p.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/qml/jsruntime/qv4jscall_p.h') diff --git a/src/qml/jsruntime/qv4jscall_p.h b/src/qml/jsruntime/qv4jscall_p.h index 46503d25e8..de4acca8a3 100644 --- a/src/qml/jsruntime/qv4jscall_p.h +++ b/src/qml/jsruntime/qv4jscall_p.h @@ -233,7 +233,7 @@ void convertAndCall(ExecutionEngine *engine, const Value *thisObject, // When the return type is QVariant, JS objects are to be returned as // QJSValue wrapped in QVariant. metaTypeFromJS unwraps them, unfortunately. if (resultType == QMetaType::fromType()) - *static_cast(result) = scope.engine->toVariant(jsResult, 0); + *static_cast(result) = scope.engine->toVariant(jsResult, QMetaType {}); else scope.engine->metaTypeFromJS(jsResult, resultType, result); } -- cgit v1.2.3