本页内容

QWaylandTouch Class

QWaylandTouch 类提供了对触摸设备的访问。更多内容...

头文件: #include <QWaylandTouch>
CMake: find_package(Qt6 REQUIRED COMPONENTS WaylandCompositor)
target_link_libraries(mytarget PRIVATE Qt6::WaylandCompositor)
qmake: QT += waylandcompositor
继承自: QWaylandObject

公共函数

QWaylandTouch(QWaylandSeat *seat, QObject *parent = nullptr)
QWaylandCompositor *compositor() const
QWaylandSeat *seat() const
virtual void sendCancelEvent(QWaylandClient *client)
virtual void sendFrameEvent(QWaylandClient *client)
virtual void sendFullTouchEvent(QWaylandSurface *surface, QTouchEvent *event)
virtual uint sendTouchPointEvent(QWaylandSurface *surface, int id, const QPointF &position, Qt::TouchPointState state)

详细说明

该类提供对QWaylandSeat 中触摸设备的访问。它对应于Wayland接口wl_touch。

成员函数文档

QWaylandTouch::QWaylandTouch(QWaylandSeat *seat, QObject *parent = nullptr)

为seat 创建一个QWaylandTouch对象,并使用给定的parent 。

QWaylandCompositor *QWaylandTouch::compositor() const

返回此QWaylandTouch 的合成器。

QWaylandSeat *QWaylandTouch::seat() const

返回该QWaylandTouch 的输入设备。

[virtual] void QWaylandTouch::sendCancelEvent(QWaylandClient *client)

向client 的触控设备发送一个触控取消事件。

[virtual] void QWaylandTouch::sendFrameEvent(QWaylandClient *client)

向client 的触摸设备发送一个触摸帧事件。这表示接触点列表的结束。

[virtual] void QWaylandTouch::sendFullTouchEvent(QWaylandSurface *surface, QTouchEvent *event)

将event 中的所有触点发送至指定的surface ,随后发送一个触点帧事件。

另请参阅 sendTouchPointEvent() 和sendFrameEvent()。

[virtual] uint QWaylandTouch::sendTouchPointEvent(QWaylandSurface *surface, int id, const QPointF &position, Qt::TouchPointState state)

向surface 的触摸设备发送一个触摸点事件,并传入给定的id 、position 和state 。

若已发送按下或松开事件,则返回该事件的序列号;否则返回 0。

© 2026 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.