本页内容

QWaylandWlShell Class

QWaylandWlShell 类是用于桌面风格用户界面的扩展。更多内容...

头文件: #include <QWaylandWlShell>
CMake: find_package(Qt6 REQUIRED COMPONENTS WaylandCompositor)
target_link_libraries(mytarget PRIVATE Qt6::WaylandCompositor)
qmake: QT += waylandcompositor
在 QML 中: WlShell
继承自: QWaylandShellTemplate

公共函数

QWaylandWlShell()
QWaylandWlShell(QWaylandCompositor *compositor)

重新实现的公共函数

virtual void initialize() override

信号

void wlShellSurfaceCreated(QWaylandWlShellSurface *shellSurface)
void wlShellSurfaceRequested(QWaylandSurface *surface, const QWaylandResource &resource)

静态公共成员

const struct wl_interface *interface()

详细说明

QWaylandWlShell 扩展提供了一种将QWaylandWlShellSurface 与常规 Wayland 表面关联的方法。通过使用 shell 表面接口,客户端可以请求调整该表面的大小、移动该表面等操作。

WlShell 对应于 Wayland 接口wl_shell 。

成员函数文档

QWaylandWlShell::QWaylandWlShell()

创建一个 QWaylandWlShell 对象。

QWaylandWlShell::QWaylandWlShell(QWaylandCompositor *compositor)

根据提供的compositor ,构建一个QWaylandWlShell对象。

[override virtual] void QWaylandWlShell::initialize()

重写了:QWaylandCompositorExtension::initialize()。

初始化WlShell 扩展。

[static] const struct wl_interface *QWaylandWlShell::interface()

返回QWaylandWlShell 的Wayland接口。

[signal] void QWaylandWlShell::wlShellSurfaceCreated(QWaylandWlShellSurface *shellSurface)

当客户端创建了wl_shell_surface 时,会发出此信号。一个常见的用例是让该信号的处理程序实例化一个QWaylandShellSurfaceItem或QWaylandQuickItem ,以便在QtQuick 场景中显示shellSurface 。

[signal] void QWaylandWlShell::wlShellSurfaceRequested(QWaylandSurface *surface, const QWaylandResource &resource)

当客户端请求将wl_shell_surface 与surface 关联时,会发出此信号。该信号的处理程序可在信号发出期间为resource 创建一个shell表面并对其进行初始化。否则,系统将自动创建一个QWaylandWlShellSurface 。

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