QPointingDeviceUniqueId Class
QPointingDeviceUniqueId 用于标识唯一对象,如与指向设备一起使用的标记令牌或触控笔。更多
头文件: | #include <QPointingDeviceUniqueId> |
CMake: | find_package(Qt6 REQUIRED COMPONENTS Gui) target_link_libraries(mytarget PRIVATE Qt6::Gui) |
qmake: | QT += gui |
- 所有成员(包括继承成员)的列表
- QPointingDeviceUniqueId 属于事件类。
属性
- numericId : const qint64
公共函数
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 可以进行等价比较,并可用作QHash 中的键。如果设备支持数字 ID,则可通过numericId() 访问数字 ID。不过,对于未来的扩展,您不应使用该函数,而应使用相等运算符比较该类型的对象。
该类是对整数 ID 的封装。您可以通过值将其传入或传出函数。
另请参见 QEventPoint 。
属性文档
[read-only]
numericId : const qint64
该属性保存触摸点所代表的令牌的唯一数字 ID。
如果设备提供了数字 ID,isValid() 将返回 true,该属性将提供数字 ID;否则返回-1。
您不应在可移植代码中使用此属性的值,而应依靠相等来识别指针。
访问函数:
qint64 | numericId() const |
另请参阅 isValid().
成员函数文档
[constexpr noexcept]
QPointingDeviceUniqueId::QPointingDeviceUniqueId()
构造一个无效的唯一指针 ID。
[static]
QPointingDeviceUniqueId QPointingDeviceUniqueId::fromNumericId(qint64 id)
从数字 IDid 生成唯一指针 ID。
[constexpr noexcept]
bool QPointingDeviceUniqueId::isValid() const
返回该唯一指针 ID 是否有效,即它是否代表一个实际指针。
相关非成员
[noexcept]
size_t qHash(QPointingDeviceUniqueId key, size_t seed = 0)
返回key 的哈希值,使用seed 作为计算的种子。
[noexcept]
bool operator!=(QPointingDeviceUniqueId lhs, QPointingDeviceUniqueId rhs)
返回两个唯一指针 IDlhs 和rhs 是否标识不同的指针 (true
) 或不标识 (false
)。
[noexcept]
bool operator==(QPointingDeviceUniqueId lhs, QPointingDeviceUniqueId rhs)
返回两个唯一指针 IDlhs 和rhs 是否标识同一个指针 (true
) 或不是 (false
)。
© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.