QPointingDeviceUniqueId 類

QPointingDeviceUniqueId 標識用於指嚮設備的唯一對象 (譬如:令牌或手寫筆)。 更多...

頭: #include <QPointingDeviceUniqueId>
CMake: find_package(Qt6 REQUIRED COMPONENTS Gui)
target_link_libraries(mytarget PRIVATE Qt6::Gui)
qmake: QT += gui

特性

公共函數

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

靜態公共成員

QPointingDeviceUniqueId fromNumericId (qint64 id )
size_t qHash (QPointingDeviceUniqueId key , size_t 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.

另請參閱 QEventPoint .

特性文檔編製

[read-only] 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.

相關非成員

size_t qHash ( QPointingDeviceUniqueId key , size_t seed = 0)

返迴哈希值為 key ,使用 seed 做計算種子。

bool operator!= ( QPointingDeviceUniqueId lhs , QPointingDeviceUniqueId rhs )

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

bool operator== ( QPointingDeviceUniqueId lhs , QPointingDeviceUniqueId rhs )

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