Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
QQuickHandlerPoint Class Reference

#include <qquickhandlerpoint_p.h>

+ Collaboration diagram for QQuickHandlerPoint:

Public Member Functions

 QQuickHandlerPoint ()
 \qmltype handlerPoint \instantiates 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 25 of file qquickhandlerpoint_p.h.

Constructor & Destructor Documentation

◆ QQuickHandlerPoint()

QT_BEGIN_NAMESPACE QQuickHandlerPoint::QQuickHandlerPoint ( )

\qmltype handlerPoint \instantiates 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 60 of file qquickhandlerpoint_p.h.

◆ ellipseDiameters()

QSizeF QQuickHandlerPoint::ellipseDiameters ( ) const
inline

Definition at line 57 of file qquickhandlerpoint_p.h.

◆ id()

int QQuickHandlerPoint::id ( ) const
inline

Definition at line 46 of file qquickhandlerpoint_p.h.

◆ localize()

void QQuickHandlerPoint::localize ( QQuickItem * item)

Definition at line 43 of file qquickhandlerpoint.cpp.

References item, and QGraphicsItem::mapFromScene().

+ Here is the call graph for this function:

◆ modifiers()

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

Definition at line 48 of file qquickhandlerpoint_p.h.

◆ position()

QPointF QQuickHandlerPoint::position ( ) const
inline

Definition at line 52 of file qquickhandlerpoint_p.h.

◆ pressedButtons()

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

Definition at line 47 of file qquickhandlerpoint_p.h.

◆ pressPosition()

QPointF QQuickHandlerPoint::pressPosition ( ) const
inline

Definition at line 49 of file qquickhandlerpoint_p.h.

◆ pressure()

qreal QQuickHandlerPoint::pressure ( ) const
inline

Definition at line 56 of file qquickhandlerpoint_p.h.

◆ reset() [1/3]

void QQuickHandlerPoint::reset ( )

Definition at line 48 of file qquickhandlerpoint.cpp.

References Qt::NoButton, Qt::NoModifier, and QPointingDevice::primaryPointingDevice().

Referenced by QQuickPinchHandler::handlePointerEventImpl(), and QQuickSinglePointHandlerPrivate::reset().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ reset() [2/3]

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

◆ reset() [3/3]

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

Definition at line 103 of file qquickhandlerpoint.cpp.

References qWarning.

◆ rotation()

qreal QQuickHandlerPoint::rotation ( ) const
inline

Definition at line 55 of file qquickhandlerpoint_p.h.

◆ sceneGrabPosition()

QPointF QQuickHandlerPoint::sceneGrabPosition ( ) const
inline

Definition at line 51 of file qquickhandlerpoint_p.h.

◆ scenePosition()

QPointF QQuickHandlerPoint::scenePosition ( ) const
inline

Definition at line 53 of file qquickhandlerpoint_p.h.

◆ scenePressPosition()

QPointF QQuickHandlerPoint::scenePressPosition ( ) const
inline

Definition at line 50 of file qquickhandlerpoint_p.h.

◆ uniqueId()

QPointingDeviceUniqueId QQuickHandlerPoint::uniqueId ( ) const
inline

Definition at line 58 of file qquickhandlerpoint_p.h.

◆ velocity()

QVector2D QQuickHandlerPoint::velocity ( ) const
inline

Definition at line 54 of file qquickhandlerpoint_p.h.

Friends And Related Symbol Documentation

◆ QQuickMultiPointHandler

friend class QQuickMultiPointHandler
friend

Definition at line 82 of file qquickhandlerpoint_p.h.

◆ QQuickSinglePointHandler

friend class QQuickSinglePointHandler
friend

Definition at line 83 of file qquickhandlerpoint_p.h.

Property Documentation

◆ device

QPointingDevice * QQuickHandlerPoint::device
read

Definition at line 40 of file qquickhandlerpoint_p.h.

◆ ellipseDiameters

QSizeF QQuickHandlerPoint::ellipseDiameters
read

Definition at line 39 of file qquickhandlerpoint_p.h.

◆ id

◆ modifiers

Qt::KeyboardModifiers QQuickHandlerPoint::modifiers
read

◆ position

◆ pressedButtons

Qt::MouseButtons QQuickHandlerPoint::pressedButtons
read

Definition at line 34 of file qquickhandlerpoint_p.h.

◆ pressPosition

◆ pressure

qreal QQuickHandlerPoint::pressure
read

Definition at line 38 of file qquickhandlerpoint_p.h.

◆ rotation

qreal QQuickHandlerPoint::rotation
read

Definition at line 37 of file qquickhandlerpoint_p.h.

Referenced by QQuickWheelHandler::handleEventPoint().

◆ sceneGrabPosition

QPointF QQuickHandlerPoint::sceneGrabPosition
read

Definition at line 33 of file qquickhandlerpoint_p.h.

Referenced by QQuickSinglePointHandler::onGrabChanged().

◆ scenePosition

◆ scenePressPosition

QPointF QQuickHandlerPoint::scenePressPosition
read

◆ uniqueId

QPointingDeviceUniqueId QQuickHandlerPoint::uniqueId
read

Definition at line 28 of file qquickhandlerpoint_p.h.

◆ velocity

QVector2D QQuickHandlerPoint::velocity
read

Definition at line 36 of file qquickhandlerpoint_p.h.


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