From aa869cbb06bcf005e238059a2cb0205947ff0b5f Mon Sep 17 00:00:00 2001 From: Michal Klocek Date: Tue, 21 Jun 2016 13:16:41 +0200 Subject: Add missing signal handling for QJSValue Emitting signal with QJSValue argument ends in QVariant converstion in qml bound signal expression evaluation. Create missing handling for arguments of type QJSValue. Change-Id: I3d51a5455c09d0eef1123941066d20ad68f4074d Reviewed-by: Erik Verbruggen Reviewed-by: Lars Knoll --- src/qml/qml/qqmlboundsignal.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/qml/qml/qqmlboundsignal.cpp') diff --git a/src/qml/qml/qqmlboundsignal.cpp b/src/qml/qml/qqmlboundsignal.cpp index 6d8f883e4c..a6fdf60c86 100644 --- a/src/qml/qml/qqmlboundsignal.cpp +++ b/src/qml/qml/qqmlboundsignal.cpp @@ -48,6 +48,7 @@ #include #include "qqmlinfo.h" +#include #include #include @@ -217,7 +218,9 @@ void QQmlBoundSignalExpression::evaluate(void **a) //### ideally we would use metaTypeToJS, however it currently gives different results // for several cases (such as QVariant type and QObject-derived types) //args[ii] = engine->metaTypeToJS(type, a[ii + 1]); - if (type == QMetaType::QVariant) { + if (type == qMetaTypeId()) { + callData->args[ii] = *QJSValuePrivate::getValue(reinterpret_cast(a[ii + 1])); + } else if (type == QMetaType::QVariant) { callData->args[ii] = scope.engine->fromVariant(*((QVariant *)a[ii + 1])); } else if (type == QMetaType::Int) { //### optimization. Can go away if we switch to metaTypeToJS, or be expanded otherwise -- cgit v1.2.3