From 41b470442898116d9f7fdbe6270a382933dc5759 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Thu, 14 Sep 2017 12:19:31 +0200 Subject: [PATCH] more debug --- touchscreentest/main.qml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/touchscreentest/main.qml b/touchscreentest/main.qml index c2cdb4aa..e9fa6277 100644 --- a/touchscreentest/main.qml +++ b/touchscreentest/main.qml @@ -8,13 +8,20 @@ ApplicationWindow { height: 480 title: qsTr("Hello World") + property real startX + property real startY + function format(text, mouse) { - return text + " " + Math.round(mouse.x*100)/100 + " " + Math.round(mouse.y*100)/100 + return text + " " + Math.round(mouse.x*100)/100 + " " + Math.round(mouse.y*100)/100 +"\nInitial: " + Math.round(startX*100)/100 +" "+Math.round(startY*100)/100 } MouseArea { anchors.fill: parent - onPressed: label.text = format("MOUSE PRESS", mouse) + onPressed: { + startX = mouse.x; + startY = mouse.y; + label.text = format("MOUSE PRESS", mouse); + } onPositionChanged: label.text = format("MOUSE Position change", mouse) onReleased: label.text = label.text = format("MOUSE Release", mouse) onCanceled: label.text = label.text = format("MOUSE Cancel", mouse)