Add centroid feedback to the WheelHandler autotest

wheelHandler.point.position is the centroid around which the item is
rotated or scaled.

Change-Id: I4993f8c6c9768dd18d1712b00354ea681bbad369
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
This commit is contained in:
Shawn Rutledge 2023-03-31 13:47:12 +02:00
parent 655b637147
commit 1c2af0f39f
1 changed files with 16 additions and 0 deletions

View File

@ -14,7 +14,23 @@ Rectangle {
}
}
Rectangle {
color: "red"
width: 6; height: 6; radius: 3
x: wheelHandler.point.position.x - radius
y: wheelHandler.point.position.y - radius
}
Text {
anchors.centerIn: parent
anchors.verticalCenterOffset: 20
color: "white"
font.pixelSize: 18
text: parent.x.toFixed(2) + ", " + parent.y.toFixed(2)
}
WheelHandler {
id: wheelHandler
activeTimeout: 0.5
}
}