QWaylandWlShellSurface Class

QWaylandWlShellSurface 类为曲面提供桌面风格的合成器特定功能。更多

Header: #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()

信号

静态公共成员

QWaylandWlShellSurface *fromResource(wl_resource *resource)

详细说明

该类是QWaylandWlShell 扩展的一部分,提供了一种方法来扩展现有QWaylandSurface 的功能,使其具备桌面风格合成器所特有的功能,如调整大小和移动表面。

它对应于 Wayland 接口wl_shell_surface

成员类型文档

enum QWaylandWlShellSurface::ResizeEdge

该枚举类型提供了一种指定曲面边缘或边角的方法。

常数描述
QWaylandWlShellSurface::NoneEdge0无边缘。
QWaylandWlShellSurface::TopEdge1上边缘
QWaylandWlShellSurface::BottomEdge2下边缘
QWaylandWlShellSurface::LeftEdge4左边缘
QWaylandWlShellSurface::TopLeftEdge5左上角
QWaylandWlShellSurface::BottomLeftEdge6左下角
QWaylandWlShellSurface::RightEdge8右边缘
QWaylandWlShellSurface::TopRightEdge9右上角
QWaylandWlShellSurface::BottomRightEdge10右下角

属性文档

[read-only] className : const QString

该属性包含QWaylandWlShellSurface 的类名。

访问功能:

QString className() const

Notifier 信号:

void classNameChanged()

[read-only] shell : QWaylandWlShell* const

此属性包含与此QWaylandWlShellSurface 相关的 shell。

访问功能:

QWaylandWlShell *shell() const

Notifier 信号:

void shellChanged()

[read-only] surface : QWaylandSurface* const

此属性保存与此QWaylandWlShellSurface 相关的曲面。

访问功能:

QWaylandSurface *surface() const

通知信号:

void surfaceChanged()

[read-only] title : const QString

该属性包含QWaylandWlShellSurface 的标题。

访问功能:

QString title() const

Notifier 信号:

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 ,并将其与给定的shellsurfaceresource 关联。

注: 可通过元对象系统和 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

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