QWaylandClientExtension Class
一个用于在 Wayland 协议上实现自定义扩展的类。更多内容...
| 头文件: | #include <QWaylandClientExtension> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS WaylandClient) target_link_libraries(mytarget PRIVATE Qt6::WaylandClient) |
| qmake: | QT += waylandclient |
| 继承自: | QObject |
| 被继承者: |
属性
- active : bool
- protocolVersion : int
公共函数
| QWaylandClientExtension(const int ver) | |
(since 6.12) | QWaylandClientExtension(int ver, QObject *parent) |
| virtual | ~QWaylandClientExtension() |
| bool | isActive() const |
| int | version() const |
信号
| void | activeChanged() |
| void | versionChanged() |
详细说明
QWaylandClientExtension类可用于实现 Wayland 协议的自定义扩展。该扩展必须同时得到合成器的支持,才能被使用。请参阅 Qt Wayland Compositor 中的“自定义扩展”示例,该示例同时实现了自定义扩展的合成器和客户端两部分。
出于便利考虑,该类通常不直接继承,而是通过QWaylandClientExtensionTemplate 进行继承。
属性文档
[read-only] active : bool
该属性保存了扩展程序的激活状态。
如果扩展当前处于活动状态,则将其设置为true 。否则,该属性的值为false 。
访问函数:
| bool | isActive() const |
通知器信号:
| void | activeChanged() |
[read-only] protocolVersion : int
该属性存储协议的版本号。
该属性存储了被请求的协议的版本。
访问函数:
| int | version() const |
通知信号:
| void | versionChanged() |
成员函数文档
[explicit] QWaylandClientExtension::QWaylandClientExtension(const int ver)
构建客户端扩展,并将它的版本设置为ver 。相当于 QWaylandClientExtension(ver, nullptr)。
[explicit, since 6.12] QWaylandClientExtension::QWaylandClientExtension(int ver, QObject *parent)
构建客户端扩展,将其版本设置为ver ,并将该扩展设为parent 的子项。
该函数于 Qt 6.12 中引入。
[virtual noexcept] QWaylandClientExtension::~QWaylandClientExtension()
销毁客户端扩展。
© 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.