WaylandQuickItem QML Type
WaylandQuickItem 类型提供了一个Qt Quick 项,该项代表 Wayland 客户端的显示区域。更多内容...
| Import Statement: | import QtWayland.Compositor |
| In C++: | QWaylandQuickItem |
| Inherited By: |
属性
- bufferLocked : bool
- compositor : WaylandCompositor
- focusOnClick : bool
- inputEventsEnabled : bool
- origin : enum
- output : WaylandOutput
- paintEnabled : bool
- subsurfaceHandler : object
- surface : WaylandSurface
- touchEventsEnabled : bool
信号
- void surfaceDestroyed()
方法
- point mapFromSurface(point point)
- point mapToSurface(point point)
- void setPrimary()
详细说明
Qt Quick基于 Wayland 的合成器可以使用此类型将客户端的内容显示在输出设备上。它会将用户输入传递给客户端。
属性文档
bufferLocked : bool
该属性表示该项的缓冲区当前是否被锁定。只要缓冲区被锁定,就不会被释放并返回给客户端。
默认值为 false。
compositor : WaylandCompositor [read-only]
该属性保存了由此WaylandQuickItem 渲染的曲面的合成器。
focusOnClick : bool
此属性用于指定当用户单击或触摸WaylandQuickItem 时,该控件是否应获得焦点。
默认值为true 。
inputEventsEnabled : bool
该属性用于指定是否为该控件启用输入事件。
当true 时,该项将处理并响应输入事件(如键盘和鼠标事件);当false 时,输入事件将被忽略。
origin : enum [read-only]
该属性反映了当前表面缓冲区的原点,即缓冲区的哪个角对应于坐标 (0, 0)。
另请参阅 WaylandSurface::origin 。
output : WaylandOutput
该属性存储用于显示此项的输出内容。
paintEnabled : bool [default: true]
将此属性设置为false 将停止渲染该项。与通过将visible 设置为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 ,或者启动关闭动画,然后销毁该Item。
如果启动了动画,应将bufferLocked 设置为确保该项在动画结束前保持其内容不变
注意: 相应的处理程序 是onSurfaceDestroyed 。
另请参阅 bufferLocked 。
方法文档
point mapFromSurface(point point)
将给定的point 在Wayland表面坐标系中的位置映射到该项坐标系中的等效点,并返回映射后的坐标。
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.