QtShell QML Type

为在Qt Wayland Compositor 上运行的 Qt XML 应用程序提供外壳扩展。更多...

Import Statement: import QtWayland.Compositor.QtShell
Since: Qt 6.3

信号

详细说明

QtShell 扩展提供了一种将QtShellSurface 与常规 Wayland 表面相关联的方法。编写 QtShell 扩展是为了支持 Qt 所支持的窗口管理功能。在合成器和客户端应用程序都使用 Qt 编写,且应用程序不会滥用手动窗口定位和 "bring-to-front "等功能的平台上,QtShell 扩展可能比较合适。

对于其他用例,可考虑使用IviApplicationXdgShell 代替。

import QtWayland.Compositor.QtShell

WaylandCompositor {
    property ListModel shellSurfaces: ListModel {}
    QtShell {
        onQtShellSurfaceCreated: {
             shellSurfaces.append({shellSurface: qtShellSurface})
        }
    }
}

信号文档

void qtShellSurfaceCreated(QtShellSurface *qtShellSurface)

当创建QtShellSurface 时,将发出该信号。所提供的qtShellSurface 最常用于实例化ShellSurfaceItem

注: 相应的处理程序是onQtShellSurfaceCreated


void qtShellSurfaceRequested(WaylandSurface surface, WaylandResource resource)

当客户端请求将QtShellSurfacesurface 关联时,会发出该信号。该信号的处理程序应为resource 创建QtShellSurface ,并在信号发射范围内将其初始化。如果没有创建QtShellSurface ,则会创建一个默认的 。

注: 相应的处理程序是onQtShellSurfaceRequested


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