Details
-
Suggestion
-
Resolution: Fixed
-
Not Evaluated
-
6.7.0
-
None
-
Since this is in the Qt documentation this is visible everywhere.
-
-
a70ddf115 (dev)
Description
In the Qt documentation page for the qt quick controls menu type there is use of the parameter "mouse" injected to the signal handler:
onClicked: { if (mouse.button === Qt.RightButton) contextMenu.popup() } onPressAndHold: { if (mouse.source === Qt.MouseEventNotSynthesized) contextMenu.popup() }
Even when you run code you get a qt.qml.context compiler message:
Parameter "mouse" is not declared. Injection of parameters into signal handlers is deprecated. Use JavaScript functions with formal parameters instead.
It can be solved by using simple lambda :
onClicked: (mouse) => { if (mouse.button === Qt.RightButton) contextMenu.popup() } onPressAndHold: (mouse) => { if (mouse.source === Qt.MouseEventNotSynthesized) contextMenu.popup() }