本页内容

QWaylandXdgSurface Class

QWaylandXdgSurface 类为 xdg 表面提供了桌面风格的、针对合成器的特定功能。更多内容...

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

属性

公共函数

QWaylandXdgSurface()
QWaylandXdgSurface(QWaylandXdgShell *xdgShell, QWaylandSurface *surface, const QWaylandResource &res)
void initialize(QWaylandXdgShell *xdgShell, QWaylandSurface *surface, const QWaylandResource &resource)
QWaylandXdgPopup *popup() const
QWaylandXdgShell *shell() const
QWaylandSurface *surface() const
QWaylandXdgToplevel *toplevel() const
QRect windowGeometry() const

信号

静态公共成员

QWaylandXdgSurface *fromResource(wl_resource *resource)
const struct wl_interface *interface()

详细说明

该类是QWaylandXdgShell 扩展的一部分,提供了一种方法,可通过桌面风格合成器特有的功能(例如调整表面大小和移动表面)来扩展现有QWaylandSurface 的功能。

它对应于 Wayland 接口xdg_surface 。

属性文档

该属性包含弹出窗口QWaylandXdgSurface 特有的属性和方法。

访问函数:

QWaylandXdgPopup *popup() const

通知器信号:

void popupCreated()

另请参阅 QWaylandXdgSurface::toplevel 和QWaylandXdgShell::popupCreated 。

[read-only] shell : QWaylandXdgShell*

该属性存储了与该QWaylandXdgSurface 关联的shell。

访问函数:

QWaylandXdgShell *shell() const

通知器信号:

void shellChanged()

[read-only] surface : QWaylandSurface*

该属性保存了与该QWaylandXdgSurface 关联的表面。

访问函数:

QWaylandSurface *surface() const

通知信号:

void surfaceChanged()

[read-only] toplevel : QWaylandXdgToplevel*

该属性包含顶级QWaylandXdgSurface 特有的属性与方法。

访问函数:

QWaylandXdgToplevel *toplevel() const

通知器信号:

void toplevelCreated()

另请参阅 QWaylandXdgSurface::popup 和QWaylandXdgShell::toplevelCreated 。

[read-only] windowGeometry : QRect

该属性保存QWaylandXdgSurface 的窗口几何信息。窗口几何信息描述了从用户视角看窗口的可见边界。该几何信息包括客户端绘制的标题栏和边框,但不包括阴影。该属性旨在用于对齐和平铺窗口。

访问函数:

QRect windowGeometry() const

通知器信号:

void windowGeometryChanged()

成员函数文档

[explicit] QWaylandXdgSurface::QWaylandXdgSurface()

创建一个 QWaylandXdgSurface 对象。

[explicit] QWaylandXdgSurface::QWaylandXdgSurface(QWaylandXdgShell *xdgShell, QWaylandSurface *surface, const QWaylandResource &res)

为surface 创建一个QWaylandXdgSurface,并使用给定的xdgShell 、surface 以及资源res 对其进行初始化。

[static] QWaylandXdgSurface *QWaylandXdgSurface::fromResource(wl_resource *resource)

返回与resource 对应的QWaylandXdgSurface 。

[invokable] void QWaylandXdgSurface::initialize(QWaylandXdgShell *xdgShell, QWaylandSurface *surface, const QWaylandResource &resource)

初始化QWaylandXdgSurface ,并将其与给定的xdgShell 、surface 和resource 关联起来。

注意: 可通过元对象系统和 QML 调用此 函数。参见Q_INVOKABLE 。

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

返回QWaylandXdgSurface 的Wayland接口。

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