<feed xmlns='http://www.w3.org/2005/Atom'>
<title>qt/qtdeclarative.git/tests/auto/qml/qqmllanguage/data/assignSignalFunctionExpression.qml, branch dev</title>
<subtitle>Qt Declarative (Quick 2)
</subtitle>
<link rel='alternate' type='text/html' href='https://code.qt.io/cgit/qt/qtdeclarative.git/'/>
<entry>
<title>Fix use of function expressions with signal handlers</title>
<updated>2015-08-24T08:12:47+00:00</updated>
<author>
<name>Simon Hausmann</name>
<email>simon.hausmann@theqtcompany.com</email>
</author>
<published>2015-08-16T13:26:40+00:00</published>
<link rel='alternate' type='text/html' href='https://code.qt.io/cgit/qt/qtdeclarative.git/commit/?id=c907eb1b5bfc22ffcee1cc37ecfa762d7a3edd0a'/>
<id>c907eb1b5bfc22ffcee1cc37ecfa762d7a3edd0a</id>
<content type='text'>
Writing

    onClicked: function(mouseEvent) { ... }

would get silently "accepted" by the engine, but it wouldn't do anything. We
basically wrapped it in a new function, so that it became

    onClicked: function(mouse){ function(mouseEvent() {} }

which is a noop. With older versions this used to produce a syntax error.
However the better fix is to simply support this kind of assignment for more
expressive signal handlers, because now the names of the signal parameters can
be explicitly named (with names of your choice).

Change-Id: I96369f8805fab97509784222f614ee17cf681aba
Reviewed-by: Lars Knoll &lt;lars.knoll@theqtcompany.com&gt;
Reviewed-by: Michael Brasser &lt;michael.brasser@live.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Writing

    onClicked: function(mouseEvent) { ... }

would get silently "accepted" by the engine, but it wouldn't do anything. We
basically wrapped it in a new function, so that it became

    onClicked: function(mouse){ function(mouseEvent() {} }

which is a noop. With older versions this used to produce a syntax error.
However the better fix is to simply support this kind of assignment for more
expressive signal handlers, because now the names of the signal parameters can
be explicitly named (with names of your choice).

Change-Id: I96369f8805fab97509784222f614ee17cf681aba
Reviewed-by: Lars Knoll &lt;lars.knoll@theqtcompany.com&gt;
Reviewed-by: Michael Brasser &lt;michael.brasser@live.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
