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)
将extension 与QWaylandObject 关联起来。
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 中的已注册扩展名列表中移除。
© 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.