Sur cette page

eventPoint QML Type

Équivalent Qml de QEventPoint. Plus...

Import Statement: import QtQuick
In C++: QEventPoint

Description détaillée

eventPoint est la représentation du type de valeur Qml de QEventPoint. Il possède les mêmes propriétés que QEventPoint.

Les propriétés suivantes sont disponibles :

L'État prend en charge les valeurs suivantes :

ConstanteDescription
EventPoint.UnknownÉtat inconnu ; identique à Qt.TouchPointUnknownState
EventPoint.StationaryLe point de l'événement n'a pas bougé ; identique à Qt.TouchPointStationary
EventPoint.PressedLe point de contact ou le bouton est enfoncé ; idem Qt.TouchPointPressed
EventPoint.UpdatedLe point d'événement a été mis à jour ; idem Qt.TouchPointMoved
EventPoint.ReleasedLe point de contact ou le bouton a été relâché ; idem Qt.TouchPointReleased

Le type States est un typedef pour QFlags<State>. Il stocke une combinaison OR de valeurs State. Voir aussi 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
            }
        }
}

Voir aussi 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.