MapPinchEvent QML Type

MapPinchEvent type provides basic information about pinch event. More...

Import Statement: import QtLocation 5.15
Since: QtLocation 5.0


Detailed Description

MapPinchEvent type provides basic information about pinch event. They are present in handlers of MapPinch (for example pinchStarted/pinchUpdated). Events are only guaranteed to be valid for the duration of the handler.

Except for the accepted property, all properties are read-only.

Example Usage

The following example enables the pinch gesture on a map and reacts to the finished event.

Map {
    id: map
    gesture.enabled: true
        var coordinate1 = map.toCoordinate(gesture.point1)
        var coordinate2 = map.toCoordinate(gesture.point2)
        console.log("Pinch started at:")
        console.log("        Points (" + gesture.point1.x + ", " + gesture.point1.y + ") - (" + gesture.point2.x + ", " + gesture.point2.y + ")")
        console.log("   Coordinates (" + coordinate1.latitude + ", " + coordinate1.longitude + ") - (" + coordinate2.latitude + ", " + coordinate2.longitude + ")")

Property Documentation

point1 : QPoint

point2 : QPoint

These read-only properties hold the actual touch points generating the pinch. The points are not in any particular order.

accepted : bool

Setting this property to false in the MapPinch::onPinchStarted handler will result in no further pinch events being generated, and the gesture ignored.

angle : real

This read-only property holds the current angle between the two points in the range -180 to 180. Positive values for the angles mean counter-clockwise while negative values mean the clockwise direction. Zero degrees is at the 3 o'clock position.

center : QPoint

This read-only property holds the current center point.

pointCount : int

This read-only property holds the number of points currently touched. The MapPinch will not react until two touch points have initiated a gesture, but will remain active until all touch points have been released.

© 2024 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.