W3cubDocs

/Qt 5.15

EventPoint QML Type

Provides information about an individual point within a PointerEvent. More...

Import Statement: import QtQuick 2.15

Properties

Detailed Description

A PointerEvent contains an EventPoint for each point of contact: one corresponding to the mouse cursor, or one for each finger touching a touchscreen.

See also PointerEvent and PointerHandler.

Property Documentation

[read-only] accepted : bool

Setting accepted to true prevents the event from being propagated to Items below the PointerHandler's Item.

Generally, if the handler acts on the mouse event, then it should be accepted so that items lower in the stacking order do not also respond to the same event.

[read-only] pointId : int

This property holds the ID of the event, if any.

Touchpoints have automatically-incrementing IDs: each time the user presses a finger against the touchscreen, it will be a larger number. In other cases, it will be -1.

See also uniqueId.

[read-only] position : point

This property holds the coordinates of the position supplied by the event, relative to the upper-left corner of the Item which has the PointerHandler. If a contact patch is available from the pointing device, this point represents its centroid.

[read-only] sceneGrabPosition : point

This property holds the scene-relative position at which the EventPoint was located when setGrabber() was called most recently.

[read-only] scenePosition : point

This property holds the coordinates of the position supplied by the event, relative to the scene. If a contact patch is available from the device, this point represents its centroid.

[read-only] scenePressPosition : point

This property holds the scene-relative position at which the press event (on a touch device) or most recent change in QQuickPointerEvent::buttons() (on a mouse or tablet stylus) occurred.

[read-only] state : int

This property tells what the user is currently doing at this point.

It can be one of:

Constant Description
Pressed The user's finger is now pressing a touchscreen, button or stylus which was not pressed already
Updated The touchpoint or position is being moved, with no change in pressed state
Stationary The touchpoint or position is not being moved, and there is also no change in pressed state
Released The user's finger has now released a touch point, button or stylus which was pressed

[read-only] timeHeld : real

This property holds the amount of time in seconds that the button or touchpoint has been held. It can be used to detect a "long press", and can drive an animation to show progress toward activation of the "long press" action.

[read-only] velocity : vector2d

This property holds average recent velocity: how fast and in which direction the event point has been moving recently.

© The Qt Company Ltd
Licensed under the GNU Free Documentation License, Version 1.3.
https://doc.qt.io/qt-5.15/qml-qtquick-eventpoint.html