QEventPoint 類提供的信息有關點在 QPointerEvent . 更多...
| 頭: |
#include <QEventPoint>
|
| CMake: |
find_package(Qt6 REQUIRED COMPONENTS Gui)
target_link_libraries(mytarget PRIVATE Qt6::Gui)
|
| qmake: |
QT += gui
|
| Since: | Qt 6.0 |
| enum | State { Unknown, Stationary, Pressed, Updated, Released } |
| flags | 狀態 |
|
|
| QEventPoint (int pointId , QEventPoint::State state , const QPointF & scenePosition , const QPointF & globalPosition ) | |
| QEventPoint (const QEventPoint & other ) | |
| QEventPoint (QEventPoint && other ) | |
| ~QEventPoint () | |
| const QPointingDevice * | device () const |
| QSizeF | ellipseDiameters () const |
| QPointF | globalGrabPosition () const |
| QPointF | globalLastPosition () const |
| QPointF | globalPosition () const |
| QPointF | globalPressPosition () const |
| QPointF | grabPosition () const |
| int | id () const |
| bool | isAccepted () const |
| QPointF | lastPosition () const |
| ulong | lastTimestamp () const |
| QPointF | normalizedPosition () const |
| QPointF | position () const |
| QPointF | pressPosition () const |
| ulong | pressTimestamp () const |
| qreal | pressure () const |
| qreal | rotation () const |
| QPointF | sceneGrabPosition () const |
| QPointF | sceneLastPosition () const |
| QPointF | scenePosition () const |
| QPointF | scenePressPosition () const |
| void | setAccepted (bool accepted = true) |
| QEventPoint::State | state () const |
| qreal | timeHeld () const |
| ulong | timestamp () const |
| QPointingDeviceUniqueId | uniqueId () const |
| QVector2D | velocity () const |
| bool | operator!= (const QEventPoint & other ) const |
| QEventPoint & | operator= (QEventPoint && other ) |
| QEventPoint & | operator= (const QEventPoint & other ) |
| bool | operator== (const QEventPoint & other ) const |
指定此事件點的狀態。
| 常量 | 值 | 描述 |
|---|---|---|
QEventPoint::Unknown
|
Qt::TouchPointUnknownState
|
未知狀態。 |
QEventPoint::Stationary
|
Qt::TouchPointStationary
|
事件點未移動。 |
QEventPoint::Pressed
|
Qt::TouchPointPressed
|
觸摸點 (或按鈕) 被按下。 |
QEventPoint::Updated
|
Qt::TouchPointMoved
|
事件點被更新。 |
QEventPoint::Released
|
Qt::TouchPointReleased
|
觸摸點 (或按鈕) 被釋放。 |
States 類型是 typedef 對於 QFlags <State>。它存儲 State 值的 OR (或) 組閤。
此特性保持事件點的接受狀態。
In widget-based applications, this property is not used, as it's only meaningful for a widget to accept or reject a complete QInputEvent .
In Qt Quick however, it's normal for an Item or Event Handler to accept only the individual points in a QTouchEvent that are actually participating in a gesture, while other points can be delivered to other items or handlers. For the sake of consistency, that applies to any QPointerEvent ; and delivery is done only when all points in a QPointerEvent have been accepted.
訪問函數:
| bool | isAccepted () const |
| void | setAccepted (bool accepted = true) |
另請參閱 QEvent::accepted .
[read-only]
device
: const
QPointingDevice
*
This property holds the pointing device from which this event point originates.
訪問函數:
| const QPointingDevice * | device () const |
[read-only]
ellipseDiameters
: const
QSizeF
This property holds the width and height of the bounding ellipse of the touch point.
The return value is in logical pixels. Most touchscreens do not detect the shape of the contact point, and no mice or tablet devices can detect it, so a null size is the most common value. On some touchscreens the diameters may be nonzero and always equal (the ellipse is approximated as a circle).
訪問函數:
| QSizeF | ellipseDiameters () const |
[read-only]
globalGrabPosition
: const
QPointF
This property holds the global position at which this point was grabbed.
The global position is relative to the screen or virtual desktop.
訪問函數:
| QPointF | globalGrabPosition () const |
另請參閱 globalPosition , grabPosition ,和 sceneGrabPosition .
[read-only]
globalLastPosition
: const
QPointF
This property holds the global position of this point from the previous press or move event.
The global position is relative to the screen or virtual desktop.
訪問函數:
| QPointF | globalLastPosition () const |
另請參閱 globalPosition , lastPosition ,和 sceneLastPosition .
[read-only]
globalPosition
: const
QPointF
This property holds the global position of this point.
The global position is relative to the screen or virtual desktop.
訪問函數:
| QPointF | globalPosition () const |
另請參閱 globalPressPosition , position ,和 scenePosition .
[read-only]
globalPressPosition
: const
QPointF
This property holds the global position at which this point was pressed.
The global position is relative to the screen or virtual desktop.
訪問函數:
| QPointF | globalPressPosition () const |
另請參閱 globalPosition , pressPosition ,和 scenePressPosition .
[read-only]
grabPosition
: const
QPointF
This property holds the position at which this point was grabbed.
The position is relative to the widget or item that received the event.
訪問函數:
| QPointF | grabPosition () const |
另請參閱 position .
[read-only]
id
: const
int
此特性保持此事件點的 ID 編號。
注意: Do not assume that ID numbers start at zero or that they are sequential. Such an assumption is often false due to the way the underlying drivers work.
訪問函數:
| int | id () const |
[read-only]
lastPosition
: const
QPointF
This property holds the position of this point from the previous press or move event.
The position is relative to the widget or item that received the event.
訪問函數:
| QPointF | lastPosition () const |
另請參閱 position and pressPosition .
[read-only]
lastTimestamp
: const
ulong
This property holds the time from the previous QPointerEvent that contained this point.
訪問函數:
| ulong | lastTimestamp () const |
另請參閱 globalLastPosition .
[read-only]
位置
: const
QPointF
此特性保持此點的位置。
The position is relative to the widget or item that received the event.
訪問函數:
| QPointF | 位置 () const |
[read-only]
pressPosition
: const
QPointF
This property holds the position at which this point was pressed.
The position is relative to the widget or item that received the event.
訪問函數:
| QPointF | pressPosition () const |
另請參閱 position .
[read-only]
pressTimestamp
: const
ulong
This property holds the most recent time at which this point was pressed.
訪問函數:
| ulong | pressTimestamp () const |
另請參閱 timestamp .
[read-only]
pressure
: const
qreal
此特性保持此點的壓力。
返迴值在範圍
0.0
to
1.0
.
訪問函數:
| qreal | pressure () const |
[read-only]
rotation
: const
qreal
This property holds the angular orientation of this point.
The return value is in degrees, where zero (the default) indicates the finger, token or stylus is pointing upwards, a negative angle means it's rotated to the left, and a positive angle means it's rotated to the right. Most touchscreens do not detect rotation, so zero is the most common value.
訪問函數:
| qreal | rotation () const |
[read-only]
sceneGrabPosition
: const
QPointF
This property holds the scene position at which this point was grabbed.
The scene position is the position relative to QQuickWindow if handled in QQuickItem::event (), in QGraphicsScene coordinates if handled by an override of QGraphicsItem::touchEvent(), or the window position in widget applications.
訪問函數:
| QPointF | sceneGrabPosition () const |
另請參閱 scenePosition , grabPosition ,和 globalGrabPosition .
[read-only]
sceneLastPosition
: const
QPointF
This property holds the scene position of this point from the previous press or move event.
The scene position is the position relative to QQuickWindow if handled in QQuickItem::event (), in QGraphicsScene coordinates if handled by an override of QGraphicsItem::touchEvent(), or the window position in widget applications.
訪問函數:
| QPointF | sceneLastPosition () const |
另請參閱 scenePosition and scenePressPosition .
[read-only]
scenePosition
: const
QPointF
This property holds the scene position of this point.
The scene position is the position relative to QQuickWindow if handled in QQuickItem::event (), in QGraphicsScene coordinates if handled by an override of QGraphicsItem::touchEvent(), or the window position in widget applications.
訪問函數:
| QPointF | scenePosition () const |
另請參閱 scenePressPosition , position ,和 globalPosition .
[read-only]
scenePressPosition
: const
QPointF
This property holds the scene position at which this point was pressed.
The scene position is the position relative to QQuickWindow if handled in QQuickItem::event (), in QGraphicsScene coordinates if handled by an override of QGraphicsItem::touchEvent(), or the window position in widget applications.
訪問函數:
| QPointF | scenePressPosition () const |
另請參閱 scenePosition , pressPosition ,和 globalPressPosition .
[read-only]
state
: const
State
此特性保持事件點的當前狀態。
訪問函數:
| QEventPoint::State | state () const |
[read-only]
timeHeld
: const
qreal
This property holds the duration, in seconds, since this point was pressed and not released.
訪問函數:
| qreal | timeHeld () const |
另請參閱 pressTimestamp and timestamp .
[read-only]
timestamp
: const
ulong
This property holds the most recent time at which this point was included in a QPointerEvent .
訪問函數:
| ulong | timestamp () const |
另請參閱 QPointerEvent::timestamp ().
[read-only]
uniqueId
: const
QPointingDeviceUniqueId
This property holds the unique ID of this point or token, if any.
It is often invalid (see isValid ()), because touchscreens cannot uniquely identify fingers.
When it comes from a QTabletEvent , it identifies the serial number of the stylus in use.
It may identify a specific token (fiducial object) when the TUIO driver is in use with a touchscreen that supports them.
訪問函數:
| QPointingDeviceUniqueId | uniqueId () const |
[read-only]
velocity
: const
QVector2D
This property holds a velocity vector, in units of pixels per second, in the coordinate. system of the screen or desktop.
注意:
If the device's capabilities include
QInputDevice::Velocity
, it means velocity comes from the operating system (perhaps the touch hardware or driver provides it). But usually the
Velocity
capability is not set, indicating that the velocity is calculated by Qt, using a simple Kalman filter to provide a smoothed average velocity rather than an instantaneous value. Effectively it tells how fast and in what direction the user has been dragging this point over the last few events, with the most recent event having the strongest influence.
訪問函數:
| QVector2D | velocity () const |
另請參閱 QInputDevice::capabilities () 和 QInputEvent::device ().
構造事件點采用給定 pointId , state , scenePosition and globalPosition .
[noexcept]
QEventPoint::
QEventPoint
(const
QEventPoint
&
other
)
Constructs an event point by making a shallow copy of other .
[noexcept]
QEventPoint::
QEventPoint
(
QEventPoint
&&
other
)
構造事件點通過移動 other .
[noexcept]
QEventPoint::
~QEventPoint
()
銷毀事件點。
返迴此點的規範化位置。
The coordinates are calculated by transforming
globalPosition
() into the space of
QInputDevice::availableVirtualGeometry
(),即
(0, 0)
is the top-left corner and
(1, 1)
is the bottom-right corner.
另請參閱 globalPosition .
[noexcept]
bool
QEventPoint::
operator!=
(const
QEventPoint
&
other
) const
返迴
true
若此事件點不等於
other
,否則返迴
false
.
[noexcept]
QEventPoint
&QEventPoint::
operator=
(
QEventPoint
&&
other
)
移動賦值 other 到此事件點實例。
[noexcept]
QEventPoint
&QEventPoint::
operator=
(const
QEventPoint
&
other
)
賦值 other to this event point and returns a reference to this event point.
[noexcept]
bool
QEventPoint::
operator==
(const
QEventPoint
&
other
) const
返迴
true
若此事件點等於
other
,否則返迴
false
.