QPointingDeviceUniqueId 类

QPointingDeviceUniqueId 标识用于指向设备的唯一对象 (譬如:令牌或手写笔)。 更多...

头: #include <QPointingDeviceUniqueId>
qmake: QT += gui
Since: Qt 5.8

该类在 Qt 5.8 引入。

特性

公共函数

QPointingDeviceUniqueId ()
bool isValid () const
qint64 numericId () const

静态公共成员

QPointingDeviceUniqueId fromNumericId (qint64 id )
uint qHash (QPointingDeviceUniqueId key , uint seed = 0)
bool operator!= (QPointingDeviceUniqueId lhs , QPointingDeviceUniqueId rhs )
bool operator== (QPointingDeviceUniqueId lhs , QPointingDeviceUniqueId rhs )

详细描述

QPointingDeviceUniqueIds can be compared for equality, and can be used as keys in a QHash . You get access to the numerical ID via numericId (), if the device supports such IDs. For future extensions, though, you should not use that function, but compare objects of this type using the equality operator.

This class is a thin wrapper around an integer ID. You pass it into and out of functions by value.

This type actively prevents you from holding it in a QList , because doing so would be very inefficient. Use a QVector instead, which has the same API as QList , but more efficient storage.

另请参阅 QTouchEvent::TouchPoint .

特性文档编制

numericId : const qint64

This property holds the numeric unique ID of the token represented by a touchpoint

If the device provides a numeric ID, isValid () returns true, and this property provides the numeric ID; otherwise it is -1.

You should not use the value of this property in portable code, but instead rely on equality to identify pointers.

访问函数:

qint64 numericId () const

另请参阅 isValid ().

成员函数文档编制

QPointingDeviceUniqueId:: QPointingDeviceUniqueId ()

构造无效的唯一指针 ID。

[static] QPointingDeviceUniqueId QPointingDeviceUniqueId:: fromNumericId ( qint64 id )

Constructs a unique pointer ID from numeric ID id .

bool QPointingDeviceUniqueId:: isValid () const

Returns whether this unique pointer ID is valid, that is, it represents an actual pointer.

相关非成员

uint qHash ( QPointingDeviceUniqueId key , uint seed = 0)

返回哈希值为 key ,使用 seed 做计算种子。

该函数在 Qt 5.8 引入。

bool operator!= ( QPointingDeviceUniqueId lhs , QPointingDeviceUniqueId rhs )

Returns whether the two unique pointer IDs lhs and rhs identify different pointers ( true ) or not ( false ).

该函数在 Qt 5.8 引入。

bool operator== ( QPointingDeviceUniqueId lhs , QPointingDeviceUniqueId rhs )

Returns whether the two unique pointer IDs lhs and rhs identify the same pointer ( true ) or not ( false ).

该函数在 Qt 5.8 引入。