aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlboundsignal.cpp
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2016-06-29 10:11:24 +0200
committerLiang Qi <liang.qi@qt.io>2016-06-29 10:11:25 +0200
commit5f2249f4dcce7523d8dc88b425b43834c4c3cab9 (patch)
tree5ddbd03806a0f940cca2d4de966c2a00d761717b /src/qml/qml/qqmlboundsignal.cpp
parentd5cb1bf4a9e19a0a4471ba5c935f441463a73414 (diff)
parent1b897195a14b63a553b139983736d8dfdd419ffd (diff)
Merge remote-tracking branch 'origin/5.6' into 5.7
Diffstat (limited to 'src/qml/qml/qqmlboundsignal.cpp')
-rw-r--r--src/qml/qml/qqmlboundsignal.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/qml/qml/qqmlboundsignal.cpp b/src/qml/qml/qqmlboundsignal.cpp
index dc215ba8a5..c6a7cde240 100644
--- a/src/qml/qml/qqmlboundsignal.cpp
+++ b/src/qml/qml/qqmlboundsignal.cpp
@@ -54,6 +54,7 @@
#include <private/qqmlcompiler_p.h>
#include "qqmlinfo.h"
+#include <private/qjsvalue_p.h>
#include <private/qv4value_p.h>
#include <private/qv4qobjectwrapper_p.h>
@@ -224,7 +225,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<QJSValue>()) {
+ callData->args[ii] = *QJSValuePrivate::getValue(reinterpret_cast<QJSValue *>(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