本页内容

QtShell QML Type

为在Qt Wayland Compositor 上运行的Qt应用程序提供一个shell扩展。更多内容...

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

信号

详细说明

QtShell 扩展提供了一种将QtShellSurface 与常规 Wayland 表面关联的方法。 QtShell 扩展旨在支持 Qt 提供的窗口管理功能。它适用于以下平台:该平台上的合成器和客户端应用程序均使用 Qt 编写,且可以信任应用程序不会滥用手动窗口定位和“置于最前”等功能。

对于其他使用场景,请考虑改用IviApplication 或XdgShell 。

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)

当客户端请求将一个QtShellSurface 与surface 关联时,会发出此信号。该信号的处理程序应为resource 创建QtShellSurface ,并在信号发出时将其初始化。如果未创建QtShellSurface ,则会自动创建一个默认的。

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

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