From 70004585f89f325f398c556d101bfa1833d87b53 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Fri, 6 Dec 2013 10:51:42 +0100 Subject: Change C++ parameter type used for var parameters in QML declared signals "signal someSignal(var foo)" mapped to foo being of type QVariant. Unfortunately that is a "lossy" type and it cannot represent all JavaScript values, including for example function closures (as reported in the JIRA bug). Instead we should use QJSValue. It is an important behavioural change because it affects the presumably rare case of somebody declaring a signal in QML with such a parameter and connect to it from C++ (or trying to emit it) - in that situation the code needs to be changed. Task-number: QTBUG-35171 Change-Id: I4fb4a18b407e4ea6c28a3a297fc6f76edb76d734 Reviewed-by: Lars Knoll --- tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp') diff --git a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp index 7b89709923..d06266a360 100644 --- a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp +++ b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp @@ -6068,6 +6068,9 @@ void tst_qqmlecmascript::signalHandlers() QMetaObject::invokeMethod(o, "testAliasSignalHandler", Q_RETURN_ARG(QVariant, result)); QCOMPARE(result.toBool(), true); + QMetaObject::invokeMethod(o, "testSignalWithClosureArgument", Q_RETURN_ARG(QVariant, result)); + QCOMPARE(result.toBool(), true); + delete o; } -- cgit v1.2.3