Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
QQuickHandlerPoint Class Reference

#include <qquickhandlerpoint_p.h>

Collaboration diagram for QQuickHandlerPoint:

Public Member Functions

 QQuickHandlerPoint ()
 \qmltype handlerPoint \nativetype QQuickHandlerPoint \inqmlmodule QtQuick
int id () const
Qt::MouseButtons pressedButtons () const
Qt::KeyboardModifiers modifiers () const
QPointF pressPosition () const
QPointF scenePressPosition () const
QPointF sceneGrabPosition () const
QPointF position () const
QPointF scenePosition () const
QVector2D velocity () const
qreal rotation () const
qreal pressure () const
QSizeF ellipseDiameters () const
QPointingDeviceUniqueId uniqueId () const
QPointingDevicedevice () const
void localize (QQuickItem *item)
void reset ()
void reset (const QPointerEvent *event, const QEventPoint &point)
void reset (const QVector< QQuickHandlerPoint > &points)

Properties

int id
QPointingDeviceUniqueId uniqueId
QPointF position
QPointF scenePosition
QPointF pressPosition
QPointF scenePressPosition
QPointF sceneGrabPosition
Qt::MouseButtons pressedButtons
Qt::KeyboardModifiers modifiers
QVector2D velocity
qreal rotation
qreal pressure
QSizeF ellipseDiameters
QPointingDevicedevice

Friends

class QQuickMultiPointHandler
class QQuickSinglePointHandler

Detailed Description

Definition at line 26 of file qquickhandlerpoint_p.h.

Constructor & Destructor Documentation

◆ QQuickHandlerPoint()

QT_BEGIN_NAMESPACE QQuickHandlerPoint::QQuickHandlerPoint ( )

\qmltype handlerPoint \nativetype QQuickHandlerPoint \inqmlmodule QtQuick

An event point.

A handler-owned QML representation of a QEventPoint.

It's possible to make bindings to properties of a handler's current \l {SinglePointHandler::point}{point} or \l {MultiPointHandler::centroid}{centroid}. For example:

import QtQuick
Item {
width: 640
height: 480
DragHandler {
id: handler
target: null
}
Text {
color: handler.active ? "darkgreen" : "black"
text: handler.centroid.position.x.toFixed(1) + "," + handler.centroid.position.y.toFixed(1)
x: handler.centroid.position.x - width / 2
y: handler.centroid.position.y - height
}
}

The point is kept up-to-date when the DragHandler is actively responding to an \l eventPoint; but after the point is released, or when the current point is being handled by a different handler, position.x and position.y are 0.

Note
This is practically identical to \l eventPoint; however an eventPoint is a short-lived copy of a long-lived Q_GADGET which is invalidated between gestures and reused for subsequent event deliveries. Continuous bindings to its properties are not possible, and an individual handler cannot rely on it outside the period when that point is part of an active gesture which that handler is handling. handlerPoint is a Q_GADGET that the handler owns. This allows you to make lifetime bindings to its properties.
See also
SinglePointHandler::point, MultiPointHandler::centroid

Definition at line 40 of file qquickhandlerpoint.cpp.

Member Function Documentation

◆ device()

QPointingDevice * QQuickHandlerPoint::device ( ) const
inline

Definition at line 61 of file qquickhandlerpoint_p.h.

◆ ellipseDiameters()

QSizeF QQuickHandlerPoint::ellipseDiameters ( ) const
inline

Definition at line 58 of file qquickhandlerpoint_p.h.

◆ id()

int QQuickHandlerPoint::id ( ) const
inline

Definition at line 47 of file qquickhandlerpoint_p.h.

◆ localize()

void QQuickHandlerPoint::localize ( QQuickItem * item)

Definition at line 43 of file qquickhandlerpoint.cpp.

◆ modifiers()

Qt::KeyboardModifiers QQuickHandlerPoint::modifiers ( ) const
inline

Definition at line 49 of file qquickhandlerpoint_p.h.

◆ position()

QPointF QQuickHandlerPoint::position ( ) const
inline

Definition at line 53 of file qquickhandlerpoint_p.h.

◆ pressedButtons()

Qt::MouseButtons QQuickHandlerPoint::pressedButtons ( ) const
inline

Definition at line 48 of file qquickhandlerpoint_p.h.

◆ pressPosition()

QPointF QQuickHandlerPoint::pressPosition ( ) const
inline

Definition at line 50 of file qquickhandlerpoint_p.h.

◆ pressure()

qreal QQuickHandlerPoint::pressure ( ) const
inline

Definition at line 57 of file qquickhandlerpoint_p.h.

◆ reset() [1/3]

void QQuickHandlerPoint::reset ( )

Definition at line 48 of file qquickhandlerpoint.cpp.

◆ reset() [2/3]

void QQuickHandlerPoint::reset ( const QPointerEvent * event,
const QEventPoint & point )

Definition at line 66 of file qquickhandlerpoint.cpp.

◆ reset() [3/3]

void QQuickHandlerPoint::reset ( const QVector< QQuickHandlerPoint > & points)

Definition at line 103 of file qquickhandlerpoint.cpp.

◆ rotation()

qreal QQuickHandlerPoint::rotation ( ) const
inline

Definition at line 56 of file qquickhandlerpoint_p.h.

◆ sceneGrabPosition()

QPointF QQuickHandlerPoint::sceneGrabPosition ( ) const
inline

Definition at line 52 of file qquickhandlerpoint_p.h.

◆ scenePosition()

QPointF QQuickHandlerPoint::scenePosition ( ) const
inline

Definition at line 54 of file qquickhandlerpoint_p.h.

◆ scenePressPosition()

QPointF QQuickHandlerPoint::scenePressPosition ( ) const
inline

Definition at line 51 of file qquickhandlerpoint_p.h.

◆ uniqueId()

QPointingDeviceUniqueId QQuickHandlerPoint::uniqueId ( ) const
inline

Definition at line 59 of file qquickhandlerpoint_p.h.

◆ velocity()

QVector2D QQuickHandlerPoint::velocity ( ) const
inline

Definition at line 55 of file qquickhandlerpoint_p.h.

◆ QQuickMultiPointHandler

friend class QQuickMultiPointHandler
friend

Definition at line 83 of file qquickhandlerpoint_p.h.

◆ QQuickSinglePointHandler

friend class QQuickSinglePointHandler
friend

Definition at line 84 of file qquickhandlerpoint_p.h.

Property Documentation

◆ device

QPointingDevice * QQuickHandlerPoint::device
read

Definition at line 41 of file qquickhandlerpoint_p.h.

◆ ellipseDiameters

QSizeF QQuickHandlerPoint::ellipseDiameters
read

Definition at line 40 of file qquickhandlerpoint_p.h.

◆ id

int QQuickHandlerPoint::id
read

Definition at line 28 of file qquickhandlerpoint_p.h.

◆ modifiers

Qt::KeyboardModifiers QQuickHandlerPoint::modifiers
read

Definition at line 36 of file qquickhandlerpoint_p.h.

◆ position

QPointF QQuickHandlerPoint::position
read

Definition at line 30 of file qquickhandlerpoint_p.h.

◆ pressedButtons

Qt::MouseButtons QQuickHandlerPoint::pressedButtons
read

Definition at line 35 of file qquickhandlerpoint_p.h.

◆ pressPosition

QPointF QQuickHandlerPoint::pressPosition
read

Definition at line 32 of file qquickhandlerpoint_p.h.

◆ pressure

qreal QQuickHandlerPoint::pressure
read

Definition at line 39 of file qquickhandlerpoint_p.h.

◆ rotation

qreal QQuickHandlerPoint::rotation
read

Definition at line 38 of file qquickhandlerpoint_p.h.

◆ sceneGrabPosition

QPointF QQuickHandlerPoint::sceneGrabPosition
read

Definition at line 34 of file qquickhandlerpoint_p.h.

◆ scenePosition

QPointF QQuickHandlerPoint::scenePosition
read

Definition at line 31 of file qquickhandlerpoint_p.h.

◆ scenePressPosition

QPointF QQuickHandlerPoint::scenePressPosition
read

Definition at line 33 of file qquickhandlerpoint_p.h.

◆ uniqueId

QPointingDeviceUniqueId QQuickHandlerPoint::uniqueId
read

Definition at line 29 of file qquickhandlerpoint_p.h.

◆ velocity

QVector2D QQuickHandlerPoint::velocity
read

Definition at line 37 of file qquickhandlerpoint_p.h.


The documentation for this class was generated from the following files: