Nesta página

eventPoint QML Type

Equivalente em QML para QEventPoint. Mais...

Import Statement: import QtQuick
In C++: QEventPoint

Descrição detalhada

eventPoint é a representação do tipo de valor Qml de QEventPoint. Possui as mesmas propriedades que QEventPoint.

As seguintes propriedades estão disponíveis:

O State suporta os seguintes valores:

ConstanteDescrição
EventPoint.UnknownEstado desconhecido; igual a Qt.TouchPointUnknownState
EventPoint.StationaryO ponto de evento não se moveu; equivalente a Qt.TouchPointStationary
EventPoint.PressedO ponto de toque ou botão está pressionado; equivalente a Qt.TouchPointPressed
EventPoint.UpdatedO ponto de evento foi atualizado; equivalente a Qt.TouchPointMoved
EventPoint.ReleasedO ponto de toque ou botão foi solto; equivalente a Qt.TouchPointReleased

O tipo States é um typedef para QFlags<State>. Ele armazena uma combinação OR de valores de State. Veja também 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
            }
        }
}

Veja também ` handlerPoint`.

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