EventPoint QML Type

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

Import Statement: import QtQuick 2.11

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:

ConstantDescription
PressedThe user's finger is now pressing a touchscreen, button or stylus which was not pressed already
UpdatedThe touchpoint or position is being moved, with no change in pressed state
StationaryThe touchpoint or position is not being moved, and there is also no change in pressed state
ReleasedThe 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.


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