mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-26 14:23:09 +00:00
more debug
This commit is contained in:
parent
410c1123d1
commit
41b4704428
1 changed files with 9 additions and 2 deletions
|
|
@ -8,13 +8,20 @@ ApplicationWindow {
|
||||||
height: 480
|
height: 480
|
||||||
title: qsTr("Hello World")
|
title: qsTr("Hello World")
|
||||||
|
|
||||||
|
property real startX
|
||||||
|
property real startY
|
||||||
|
|
||||||
function format(text, mouse) {
|
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 {
|
MouseArea {
|
||||||
anchors.fill: parent
|
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)
|
onPositionChanged: label.text = format("MOUSE Position change", mouse)
|
||||||
onReleased: label.text = label.text = format("MOUSE Release", mouse)
|
onReleased: label.text = label.text = format("MOUSE Release", mouse)
|
||||||
onCanceled: label.text = label.text = format("MOUSE Cancel", mouse)
|
onCanceled: label.text = label.text = format("MOUSE Cancel", mouse)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue