diff options
Diffstat (limited to 'tests/manual/pointer/map.qml')
-rw-r--r-- | tests/manual/pointer/map.qml | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/manual/pointer/map.qml b/tests/manual/pointer/map.qml index ae7ec042d3..3ed732b523 100644 --- a/tests/manual/pointer/map.qml +++ b/tests/manual/pointer/map.qml @@ -39,6 +39,7 @@ Item { y: (parent.height - height) / 2 width: image.width height: image.height + transform: Rotation { id: tilt; origin.x: width / 2; origin.y: height / 2; axis { x: 1; y: 0; z: 0 } } Image { id: image @@ -57,16 +58,29 @@ Item { PinchHandler { id: pinch + objectName: "two-point pinch" target: map minimumScale: 0.1 maximumScale: 10 onActiveChanged: if (!active) reRenderIfNecessary() + grabPermissions: PinchHandler.TakeOverForbidden // don't allow takeover if pinch has started } DragHandler { + objectName: "single-point drag" target: map } + DragHandler { + id: tiltHandler + objectName: "two-point tilt" + minimumPointCount: 2 + maximumPointCount: 2 + xAxis.enabled: false + target: null + onTranslationChanged: tilt.angle = translation.y / -2 + } + function reRenderIfNecessary() { var newSourceWidth = image.sourceSize.width * pinch.scale var ratio = newSourceWidth / image.sourceSize.width |