本页内容

WaylandSurface QML Type (Uncreatable)

表示输出设备上的一个矩形区域。更多...

Import Statement: import QtWayland.Compositor
In C++: QWaylandSurface

注意:这是一个无法创建的类型。无法在 QML 中对其进行实例化。

属性

信号

方法

详细说明

该类型封装了一个显示在输出设备上的矩形像素区域。它对应于 Wayland 协议中的wl_surface 接口。

属性文档

bufferScale : size [read-only]

此属性存储WaylandSurface 的缓冲区比例。缓冲区比例允许客户端提供更高分辨率的缓冲区数据,以便在高分辨率输出中使用。

bufferSize : size [read-only]

该属性存储了此WaylandSurface 当前缓冲区的大小(以像素为单位),而非以表面坐标为单位。

若需获取以表面坐标为单位的尺寸,请改用 `destinationSize `。

另请参阅 destinationSize 和bufferScale 。

client : WaylandClient [read-only]

该属性保存了使用此WaylandSurface 的客户端。

contentOrientation : enum [read-only]

该属性保存了WaylandSurface 内容的朝向。

另请参阅 WaylandOutput.transform 。

cursorSurface : bool

该属性用于指定WaylandSurface 是否为游标曲面。

destinationSize : size [read-only]

该属性存储了该WaylandSurface 在表面坐标系中的大小。

另请参阅 bufferScale 和bufferSize 。

hasContent : bool [read-only]

该属性用于指示该曲面当前是否拥有一个已提交且不为空的缓冲区。

另请参阅 WaylandSurface::bufferSize 。

inhibitsIdle : bool [read-only]

该属性用于指定该表面是否旨在阻止合成器的空闲行为,例如屏幕变黑、锁定和屏幕保护。

另请参阅 IdleInhibitManagerV1 。

isOpaque : bool [read-only, since 6.4]

该属性表示表面是否完全不透明,这由客户端通过 set_opaque_region 请求报告。

该属性在 Qt 6.4 中引入。

origin : enum [read-only]

该属性存储WaylandSurface 缓冲区的原点,如果该表面没有缓冲区,则存储WaylandSurface.OriginTopLeft。

该属性可取以下值:

sourceGeometry : rect [read-only]

该属性描述了应绘制在屏幕上的附加 Wayland 缓冲区的那一部分。坐标以缓冲区的左上角为原点,并按bufferScale 进行缩放。

另请参阅 bufferScale 、bufferSize 以及destinationSize 。

useTextureAlpha : bool [default: true]

此属性指定曲面是否应使用纹理透明度进行混合。

当true 时,将使用表面的Alpha通道进行混合;当false 时,该表面将被视为不透明。

Signal 文档

childAdded(WaylandSurface child)

当向曲面添加了一个 wl_subsurface(child )时,会触发此信号。

注意: 相应的处理程序 为onChildAdded 。

void dragStarted(WaylandDrag drag)

当drag 从该界面启动时,会发出此信号。

注意: 相应的处理程序 为onDragStarted 。

surfaceDestroyed()

当相应的 wl_surface 被销毁时,会发出此信号。

注意: 相应的处理程序 为onSurfaceDestroyed 。

方法文档

void destroy()

销毁WaylandSurface 。

void initialize(WaylandCompositor compositor, WaylandClient client, int id, int version)

使用给定的compositor 和client ,以及给定的id 和version ,初始化WaylandSurface 。

bool isDestroyed()

如果WaylandSurface 已被销毁,则返回true ;否则返回false 。

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