QWaylandWlShellSurface Class
QWaylandWlShellSurface 类为表面提供了桌面风格的、针对特定合成器的功能。更多...
| 头文件: | #include <QWaylandWlShellSurface> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS WaylandCompositor) target_link_libraries(mytarget PRIVATE Qt6::WaylandCompositor) |
| qmake: | QT += waylandcompositor |
| 在 QML 中: | WlShellSurface |
| 继承自: | QWaylandShellSurfaceTemplate |
公共类型
| enum | ResizeEdge { NoneEdge, TopEdge, BottomEdge, LeftEdge, TopLeftEdge, …, BottomRightEdge } |
属性
公共函数
| QWaylandWlShellSurface() | |
| QWaylandWlShellSurface(QWaylandWlShell *shell, QWaylandSurface *surface, const QWaylandResource &res) | |
| QString | className() const |
| void | initialize(QWaylandWlShell *shell, QWaylandSurface *surface, const QWaylandResource &resource) |
| void | sendConfigure(const QSize &size, QWaylandWlShellSurface::ResizeEdge edges) |
| void | sendPopupDone() |
| QWaylandWlShell * | shell() const |
| QWaylandSurface * | surface() const |
| QString | title() const |
公共槽位
| void | ping() |
信号
| void | classNameChanged() |
| void | shellChanged() |
| void | surfaceChanged() |
| void | titleChanged() |
静态公共成员
| QWaylandWlShellSurface * | fromResource(wl_resource *resource) |
详细说明
该类是QWaylandWlShell 扩展的一部分,提供了一种方法,可通过桌面风格合成器特有的功能(例如调整表面大小和移动表面)来扩展现有QWaylandSurface 的功能。
它对应于 Wayland 接口wl_shell_surface 。
成员类型文档
enum QWaylandWlShellSurface::ResizeEdge
此枚举类型提供了一种指定曲面边缘或顶点的方法。
| 常量 | 值 | 描述 |
|---|---|---|
QWaylandWlShellSurface::NoneEdge | 0 | 无边缘。 |
QWaylandWlShellSurface::TopEdge | 1 | 顶边。 |
QWaylandWlShellSurface::BottomEdge | 2 | 底部边缘。 |
QWaylandWlShellSurface::LeftEdge | 4 | 左侧边缘。 |
QWaylandWlShellSurface::TopLeftEdge | 5 | 左上角。 |
QWaylandWlShellSurface::BottomLeftEdge | 6 | 左下角。 |
QWaylandWlShellSurface::RightEdge | 8 | 右边缘。 |
QWaylandWlShellSurface::TopRightEdge | 9 | 右上角。 |
QWaylandWlShellSurface::BottomRightEdge | 10 | 右下角。 |
属性文档
[read-only] className : QString
该属性存储QWaylandWlShellSurface 的类名。
访问函数:
| QString | className() const |
通知器信号:
| void | classNameChanged() |
[read-only] shell : QWaylandWlShell*
该属性存储了与该QWaylandWlShellSurface 关联的shell。
访问函数:
| QWaylandWlShell * | shell() const |
通知器信号:
| void | shellChanged() |
[read-only] surface : QWaylandSurface*
该属性存储与该QWaylandWlShellSurface 关联的表面。
访问函数:
| QWaylandSurface * | surface() const |
通知器信号:
| void | surfaceChanged() |
[read-only] title : QString
该物业荣获“QWaylandWlShellSurface ”称号。
访问函数:
| QString | title() const |
通知器信号:
| void | titleChanged() |
成员函数文档
QWaylandWlShellSurface::QWaylandWlShellSurface()
创建一个 QWaylandWlShellSurface。
QWaylandWlShellSurface::QWaylandWlShellSurface(QWaylandWlShell *shell, QWaylandSurface *surface, const QWaylandResource &res)
为surface 创建一个QWaylandWlShellSurface,并使用给定的shell 和资源res 对其进行初始化。
[static] QWaylandWlShellSurface *QWaylandWlShellSurface::fromResource(wl_resource *resource)
返回与给定的 `resource` 关联的 `QWaylandWlShellSurface ` 对象;如果不存在此类对象,则返回 `null`。
[invokable] void QWaylandWlShellSurface::initialize(QWaylandWlShell *shell, QWaylandSurface *surface, const QWaylandResource &resource)
初始化QWaylandWlShellSurface ,并将其与给定的shell 、surface 和resource 关联起来。
注意: 可通过元对象系统和 QML 调用此 函数。参见Q_INVOKABLE 。
[slot] void QWaylandWlShellSurface::ping()
向客户端发送一个ping事件。如果客户端对该事件做出响应,则会发出pong信号。
[invokable] void QWaylandWlShellSurface::sendConfigure(const QSize &size, QWaylandWlShellSurface::ResizeEdge edges)
向客户端发送一个配置事件,建议其将画布调整为给定的size 。edges 提供了有关画布如何被调整大小的提示。
注意:此 函数可通过元对象系统和 QML 调用。参见Q_INVOKABLE 。
[invokable] void QWaylandWlShellSurface::sendPopupDone()
向客户端发送一个 popup_done 事件,以指示用户已在客户端工作区外的某处点击。
注意:此 函数可通过元对象系统和 QML 调用。参见Q_INVOKABLE 。
© 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.