在本页

WaylandQuickItem QML Type

Provides aQt Quick item that represents aWaylandView.More...

Import Statement: import QtWayland.Compositor
In C++: QWaylandQuickItem
Inherited By:

ShellSurfaceItem

属性

信号

方法

详细说明

Qt Quick-基于 Wayland 的合成器可使用此类型在输出设备上显示客户端的内容。它将用户输入传递给客户端。

属性文档

bufferLocked : bool

该属性显示项目的缓冲区当前是否被锁定。只要缓冲区处于锁定状态,就不会释放并返回给客户端。

默认值为 false。

compositor : WaylandCompositor [read-only]

此属性用于保存此WaylandQuickItem 渲染的曲面的合成器。

focusOnClick : bool

该属性指定WaylandQuickItem 在被点击或触摸时是否应获得焦点。

默认值为true

inputEventsEnabled : bool

此属性表示是否启用此项目的输入事件。

true 时,项目将处理键盘和鼠标事件等输入事件;当false 时,输入事件将被忽略。

origin : enum [read-only]

这一特性决定了QWaylandQuickItem 的原点。

output : WaylandOutput

此属性用于显示此项目的输出。

paintEnabled : bool

如果项目被隐藏,则返回 true,但纹理仍会更新。与通过将visible 设置为false 来隐藏项目相反,将此属性设置为false 不会阻止鼠标或键盘输入到达项目。

subsurfaceHandler : object

该属性提供了一种覆盖默认子表面行为的方法。

默认情况下,Qt 将创建一个新的 SurfaceItem 作为此项目的子项,并保持正确的位置。

要覆盖默认值,可为该属性指定一个处理程序对象。处理程序应实现 handleSubsurfaceAdded(WaylandSurface) 函数。

ShellSurfaceItem {
    subsurfaceHandler: QtObject {
        function handleSubsurfaceAdded(child) {
          // create custom surface item, and connect the subsurfacePositionChanged signal
        }
    }
}

此属性的默认值为null

surface : WaylandSurface

该属性用于保存WaylandQuickItem 渲染的表面。

touchEventsEnabled : bool

如果触摸事件被转发到客户端表面,则此属性为true ,否则为false

信号文档

void surfaceDestroyed()

当客户端销毁了与WaylandQuickItem 关联的wl_surface 时,就会发出该信号。该信号的处理程序应立即销毁WaylandQuickItem 或启动关闭动画,然后销毁该项目。

如果启动了动画,则应设置bufferLocked ,以确保项目在动画结束前保持其内容。

注: 相应的处理程序是onSurfaceDestroyed

另请参阅 bufferLocked

方法文档

point mapFromSurface(point point)

将 Wayland 表面坐标系中给定的point 映射到此项目坐标系中的对应点,并返回映射后的坐标。

point mapToSurface(point point)

将此项目坐标系中给定的point 映射到 Wayland 表面坐标系中的对应点,并返回映射后的坐标。

void setPrimary()

使WaylandQuickItem 成为曲面的主视图。

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