eventPoint QML Type

Qml equivalent for QEventPoint. More...

Import Statement: import QtQuick
Instantiates: QEventPoint

Detailed Description

eventPoint is the Qml value type representation of QEventPoint. It has the same properties as QEventPoint.

The following properties are available:

State supports the following values:

ConstantDescription
EventPoint.UnknownUnknown state; same as Qt.TouchPointUnknownState
EventPoint.StationaryThe event point did not move; same as Qt.TouchPointStationary
EventPoint.PressedThe touch point or button is pressed; same as Qt.TouchPointPressed
EventPoint.UpdatedThe event point was updated; same as Qt.TouchPointMoved
EventPoint.ReleasedThe touch point or button was released; same as Qt.TouchPointReleased

The States type is a typedef for QFlags<State>. It stores an OR combination of State values. See also QEventPoint::States

TapHandler {
    gesturePolicy: TapHandler.ReleaseWithinBounds // exclusive grab on press
    onGrabChanged:
        (transition, eventPoint) => {
            switch (transition) {
                case PointerDevice.GrabExclusive:
                    console.log("took exclusive grab of point", eventPoint.id,
                                "on", eventPoint.device.name)
                    break
                case PointerDevice.UngrabExclusive:
                    console.log("gave up exclusive grab of point", eventPoint.id,
                                "on", eventPoint.device.name)
                    break
                case PointerDevice.CancelGrabExclusive:
                    console.log("exclusive grab of point", eventPoint.id,
                                "on", eventPoint.device.name, "has been cancelled")
                    break
            }

            switch (eventPoint.state) {
                case EventPoint.Pressed:
                    console.log("on press @", eventPoint.position);
                    break
                case EventPoint.Updated:
                    console.log("on update @", eventPoint.position);
                    break
                case EventPoint.Released:
                    console.log("on release @", eventPoint.position);
                    break
                default:
                    console.log(eventPoint.position, "state", eventPoint.state)
                    break
            }
        }
}

See also handlerPoint.

© 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.