aboutsummaryrefslogtreecommitdiffstats
path: root/examples/quick/tutorials/samegame
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2021-02-12 08:53:00 +0100
committerUlf Hermann <ulf.hermann@qt.io>2021-02-12 10:30:20 +0000
commit4cc91a6a0e4f9063233a4d6554ae64855cf99c14 (patch)
tree89175c0d09b16926a95c3b1239f73971beacf5bb /examples/quick/tutorials/samegame
parenteaa9993682f02ef0420ec49b816da27db3ca00c2 (diff)
Use functions as signal handlers when accessing parameters
Injected signal handlers are bad practice because they aren't declared. Pick-to: 6.1 Task-number: QTBUG-89943 Change-Id: I3a691f68342a199bd63034637aa7ed438e3a037b Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'examples/quick/tutorials/samegame')
-rw-r--r--examples/quick/tutorials/samegame/samegame3/samegame.qml2
-rw-r--r--examples/quick/tutorials/samegame/samegame4/samegame.qml3
2 files changed, 3 insertions, 2 deletions
diff --git a/examples/quick/tutorials/samegame/samegame3/samegame.qml b/examples/quick/tutorials/samegame/samegame3/samegame.qml
index a84cc67146..11376232a2 100644
--- a/examples/quick/tutorials/samegame/samegame3/samegame.qml
+++ b/examples/quick/tutorials/samegame/samegame3/samegame.qml
@@ -83,7 +83,7 @@ Rectangle {
MouseArea {
anchors.fill: parent
- onClicked: SameGame.handleClick(mouse.x, mouse.y)
+ onClicked: (mouse)=> SameGame.handleClick(mouse.x, mouse.y)
}
}
//![1]
diff --git a/examples/quick/tutorials/samegame/samegame4/samegame.qml b/examples/quick/tutorials/samegame/samegame4/samegame.qml
index 2bfdca9bd6..0cdbcd8cb0 100644
--- a/examples/quick/tutorials/samegame/samegame4/samegame.qml
+++ b/examples/quick/tutorials/samegame/samegame4/samegame.qml
@@ -80,7 +80,8 @@ Rectangle {
height: parent.height - (parent.height % blockSize);
MouseArea {
- anchors.fill: parent; onClicked: SameGame.handleClick(mouse.x,mouse.y);
+ anchors.fill: parent
+ onClicked: (mouse)=> SameGame.handleClick(mouse.x,mouse.y);
}
}
}