QWaylandXdgSurface Class

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

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

属性

  • popup : QWaylandXdgPopup* const
  • shell : QWaylandXdgShell* const
  • surface : QWaylandSurface* const

公共功能

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

Notifier 信号:

void popupCreated()

另请参阅 QWaylandXdgSurface::toplevelQWaylandXdgShell::popupCreated

[read-only] shell : QWaylandXdgShell* const

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

访问功能:

QWaylandXdgShell *shell() const

Notifier 信号:

void shellChanged()

[read-only] surface : QWaylandSurface* const

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

访问功能:

QWaylandSurface *surface() const

通知信号:

void surfaceChanged()

[read-only] toplevel : QWaylandXdgToplevel* const

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

访问功能:

QWaylandXdgToplevel *toplevel() const

Notifier 信号:

void toplevelCreated()

另请参阅 QWaylandXdgSurface::popupQWaylandXdgShell::toplevelCreated

[read-only] windowGeometry : const QRect

该属性用于保存QWaylandXdgSurface 的窗口几何图形。窗口几何图形从用户角度描述了窗口的可见边界。几何图形包括标题栏和边框(如果由客户端绘制),但不包括阴影。该属性用于对齐和平铺窗口。

访问功能:

QRect windowGeometry() const

Notifier 信号:

void windowGeometryChanged()

成员函数文档

[explicit] QWaylandXdgSurface::QWaylandXdgSurface()

构造一个 QWaylandXdgSurface。

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

surface 构建 QWaylandXdgSurface,并使用给定的xdgShellsurface 和资源res 对其进行初始化。

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

返回与resource 对应的QWaylandXdgSurface

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

初始化QWaylandXdgSurface ,将其与给定的xdgShellsurfaceresource 关联。

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

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

返回QWaylandXdgSurface 的 Wayland 界面。

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