QWaylandObject Class
QWaylandObject 是可包含 Wayland 扩展的对象的基类。更多
头文件: | #include <QWaylandObject> |
CMake: | find_package(Qt6 REQUIRED COMPONENTS WaylandCompositor) target_link_libraries(mytarget PRIVATE Qt6::WaylandCompositor) |
qmake: | QT += waylandcompositor |
继承: | QObject |
继承者: | QWaylandCompositor,QWaylandCompositorExtension,QWaylandKeyboard,QWaylandOutput,QWaylandPointer,QWaylandSeat,QWaylandSurface, 以及QWaylandTouch |
公共函数
void | addExtension(QWaylandCompositorExtension *extension) |
QWaylandCompositorExtension * | extension(const QByteArray &name) |
QWaylandCompositorExtension * | extension(const wl_interface *interface) |
QList<QWaylandCompositorExtension *> | extensions() const |
void | removeExtension(QWaylandCompositorExtension *extension) |
保护函数
QWaylandObject(QObject *parent = nullptr) |
详细说明
QWaylandObject 封装了扩展容器功能。任何 QWaylandObject 对象都将自动成为扩展容器,而作为其子对象的QWaylandCompositorExtension 对象将自动将自身添加到扩展列表中,并在扩展对象销毁时移除自身。
成员函数文档
[protected]
QWaylandObject::QWaylandObject(QObject *parent = nullptr)
创建一个 QWaylandObject 作为parent 的子对象。
void QWaylandObject::addExtension(QWaylandCompositorExtension *extension)
通过QWaylandObject 注册extension 。
QWaylandCompositorExtension *QWaylandObject::extension(const QByteArray &name)
如果已在QWaylandObject 注册,则返回与name 匹配的合成器扩展名。如果未注册与名称匹配的扩展名,则此函数返回 null。
QWaylandCompositorExtension *QWaylandObject::extension(const wl_interface *interface)
如果已在QWaylandObject 注册,则返回与interface 匹配的合成器扩展名。如果未注册与接口匹配的扩展名,则此函数返回 null。
QList<QWaylandCompositorExtension *> QWaylandObject::extensions() const
返回已在此QWaylandObject 注册的合成器扩展名列表。
void QWaylandObject::removeExtension(QWaylandCompositorExtension *extension)
如果extension 以前已使用addExtension() 注册过,则将其从该QWaylandObject 的已注册扩展名列表中删除。
© 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.