aboutsummaryrefslogtreecommitdiffstats
path: root/examples/quick/tutorials
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2021-02-12 08:53:00 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-02-12 16:18:28 +0000
commit8784a2778063cf928b27a908f6580ed37cb4035d (patch)
tree5a0871bc6fdd795d7971bc43c3811ee467d4ff38 /examples/quick/tutorials
parent0e92e0bd6e7209ad491472b3928840ad78c5371a (diff)
Use functions as signal handlers when accessing parameters
Injected signal handlers are bad practice because they aren't declared. Task-number: QTBUG-89943 Change-Id: I3a691f68342a199bd63034637aa7ed438e3a037b Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 4cc91a6a0e4f9063233a4d6554ae64855cf99c14) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'examples/quick/tutorials')
-rw-r--r--examples/quick/tutorials/dynamicview/dynamicview3/dynamicview.qml2
-rw-r--r--examples/quick/tutorials/dynamicview/dynamicview4/dynamicview.qml2
-rw-r--r--examples/quick/tutorials/samegame/samegame3/samegame.qml2
-rw-r--r--examples/quick/tutorials/samegame/samegame4/samegame.qml3
4 files changed, 5 insertions, 4 deletions
diff --git a/examples/quick/tutorials/dynamicview/dynamicview3/dynamicview.qml b/examples/quick/tutorials/dynamicview/dynamicview3/dynamicview.qml
index 6c64ee2893..eb42a76a47 100644
--- a/examples/quick/tutorials/dynamicview/dynamicview3/dynamicview.qml
+++ b/examples/quick/tutorials/dynamicview/dynamicview3/dynamicview.qml
@@ -120,7 +120,7 @@ Rectangle {
DropArea {
anchors { fill: parent; margins: 10 }
- onEntered: {
+ onEntered: (drag)=> {
visualModel.items.move(
drag.source.DelegateModel.itemsIndex,
dragArea.DelegateModel.itemsIndex)
diff --git a/examples/quick/tutorials/dynamicview/dynamicview4/dynamicview.qml b/examples/quick/tutorials/dynamicview/dynamicview4/dynamicview.qml
index 327ca0cea7..f40f060e7c 100644
--- a/examples/quick/tutorials/dynamicview/dynamicview4/dynamicview.qml
+++ b/examples/quick/tutorials/dynamicview/dynamicview4/dynamicview.qml
@@ -121,7 +121,7 @@ Rectangle {
DropArea {
anchors { fill: parent; margins: 10 }
- onEntered: {
+ onEntered: (drag)=> {
visualModel.items.move(
drag.source.DelegateModel.itemsIndex,
dragArea.DelegateModel.itemsIndex)
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);
}
}
}