QPointerEvent Class
指针事件的基类。更多
头文件: | #include <QPointerEvent> |
CMake: | find_package(Qt6 REQUIRED COMPONENTS Gui) target_link_libraries(mytarget PRIVATE Qt6::Gui) |
qmake: | QT += gui |
自 | Qt 6.0 |
继承 | QInputEvent |
继承于 |
公共函数
bool | addPassiveGrabber(const QEventPoint &point, QObject *grabber) |
bool | allPointsAccepted() const |
bool | allPointsGrabbed() const |
void | clearPassiveGrabbers(const QEventPoint &point) |
QObject * | exclusiveGrabber(const QEventPoint &point) const |
QList<QPointer<QObject>> | passiveGrabbers(const QEventPoint &point) const |
QEventPoint & | point(qsizetype i) |
QEventPoint * | pointById(int id) |
qsizetype | pointCount() const |
QPointingDevice::PointerType | pointerType() const |
const QPointingDevice * | pointingDevice() const |
const QList<QEventPoint> & | points() const |
bool | removePassiveGrabber(const QEventPoint &point, QObject *grabber) |
void | setExclusiveGrabber(const QEventPoint &point, QObject *exclusiveGrabber) |
重新实现的公共函数
virtual void | setAccepted(bool accepted) override |
成员函数文档
bool QPointerEvent::addPassiveGrabber(const QEventPoint &point, QObject *grabber)
通知传送逻辑,给定的grabber 将接收所有未来更新事件和包含给定point 的发布事件,无论这些事件可能传送到何处。
它仅供Qt Quick 输入处理程序使用。
如果grabber 已被添加,则返回false
,否则返回true
。
bool QPointerEvent::allPointsAccepted() const
如果points() 中的每个点的 isPointAccepted() 都是true
,则返回true
;否则返回false
。
bool QPointerEvent::allPointsGrabbed() const
如果points() 中的每个点都有一个exclusiveGrabber() 或一个或多个passiveGrabbers() ,则返回true
。
void QPointerEvent::clearPassiveGrabbers(const QEventPoint &point)
移除给定point 中的所有被动抓取器。
它仅供Qt Quick 输入处理程序使用。
另请参阅 QPointerEvent::addPassiveGrabber() 。
QObject *QPointerEvent::exclusiveGrabber(const QEventPoint &point) const
返回已设置为接收所有未来更新事件和包含给定point 的发布事件的对象。
目前主要用于Qt Quick 。
另请参阅 setExclusiveGrabber() 。
QList<QPointer<QObject>> QPointerEvent::passiveGrabbers(const QEventPoint &point) const
返回已请求接收所有未来更新事件和包含给定point 的发布事件的对象列表。
它仅供Qt Quick 输入处理程序使用。
另请参阅 QPointerEvent::addPassiveGrabber()。
QEventPoint &QPointerEvent::point(qsizetype i)
返回索引i 处点的QEventPoint 引用。
QEventPoint *QPointerEvent::pointById(int id)
返回id 与给定的id 匹配的点,如果找不到,则返回nullptr
。
qsizetype QPointerEvent::pointCount() const
返回指针事件中的点数。
QPointingDevice::PointerType QPointerEvent::pointerType() const
返回生成事件的点的类型。
const QPointingDevice *QPointerEvent::pointingDevice() const
返回该事件的源设备。
它与QInputEvent::device() 相同,但为方便起见进行了类型转换。
const QList<QEventPoint> &QPointerEvent::points() const
返回指针事件中的点列表。
bool QPointerEvent::removePassiveGrabber(const QEventPoint &point, QObject *grabber)
从给定的point (如果之前已添加)中删除被动grabber 。如果之前是被动抓取器,则返回true
;如果不是,则返回false
。
它仅供Qt Quick 输入处理程序使用。
另请参阅 QPointerEvent::addPassiveGrabber().
[override virtual]
void QPointerEvent::setAccepted(bool accepted)
void QPointerEvent::setExclusiveGrabber(const QEventPoint &point, QObject *exclusiveGrabber)
通知传送逻辑,给定的exclusiveGrabber 将接收所有未来的更新事件和包含给定point 的发布事件,其他项目的传送可以跳过。
目前主要用于Qt Quick 。
另请参阅 exclusiveGrabber() 。
© 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.