In questa pagina

eventPoint QML Type

Equivalente in Qml per QEventPoint. Altro...

Import Statement: import QtQuick
In C++: QEventPoint

Descrizione dettagliata

eventPoint è la rappresentazione in tipo di valore QML di QEventPoint. Ha le stesse proprietà di QEventPoint.

Sono disponibili le seguenti proprietà:

Lo stato sostiene i seguenti valori:

CostanteDescrizione
EventPoint.UnknownStato sconosciuto; equivalente a Qt.TouchPointUnknownState
EventPoint.StationaryIl punto dell'evento non si è spostato; equivalente a Qt.TouchPointStationary
EventPoint.PressedIl punto di tocco o il pulsante è stato premuto; equivalente a Qt.TouchPointPressed
EventPoint.UpdatedIl punto dell'evento è stato aggiornato; equivalente a Qt.TouchPointMoved
EventPoint.ReleasedIl punto di tocco o il pulsante è stato rilasciato; equivalente a Qt.TouchPointReleased

Il tipo States è un typedef per QFlags<State>. Memorizza una combinazione OR di valori State. Vedi anche 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
            }
        }
}

Vedi anche ` 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.