QWaylandTouch Class

QWaylandTouch 类提供对触摸设备的访问。更多

Header: #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 并使用给定的parent 构建一个 QWaylandTouch。

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)

使用给定的idpositionstatesurface 的触摸设备发送触摸点事件。

如果发送了向下或向上事件,则返回该事件的序列,否则返回 0。

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