diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2021-02-12 08:53:00 +0100 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2021-02-12 10:30:20 +0000 |
commit | 4cc91a6a0e4f9063233a4d6554ae64855cf99c14 (patch) | |
tree | 89175c0d09b16926a95c3b1239f73971beacf5bb /examples/quick/shapes | |
parent | eaa9993682f02ef0420ec49b816da27db3ca00c2 (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/shapes')
-rw-r--r-- | examples/quick/shapes/content/interactive.qml | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/examples/quick/shapes/content/interactive.qml b/examples/quick/shapes/content/interactive.qml index 78413db3f9..1f7aad3ab0 100644 --- a/examples/quick/shapes/content/interactive.qml +++ b/examples/quick/shapes/content/interactive.qml @@ -190,7 +190,7 @@ Rectangle { onExited: color = rr.color onPressed: a = true onReleased: a = false - onPositionChanged: { + onPositionChanged: (mouse)=> { if (a) { var pt = mapToItem(rr.parent, mouse.x, mouse.y); rr.obj[rr.xprop] = pt.x @@ -323,10 +323,10 @@ Rectangle { MouseArea { anchors.fill: parent - onPressed: { + onPressed: (mouse)=> { canvas.funcs[root.mode].start(mouse.x, mouse.y); } - onPositionChanged: { + onPositionChanged: (mouse)=> { canvas.funcs[root.mode].move(mouse.x, mouse.y); } onReleased: { |