本页内容

XdgDecorationManagerV1 QML Type

提供了一个用于协商服务器端和客户端窗口装饰的扩展。更多内容...

Import Statement: import QtWayland.Compositor.XdgShell
In C++: QWaylandXdgDecorationManagerV1

属性

详细说明

XdgDecorationManagerV1 扩展为合成器提供了一种声明支持服务器端窗口装饰的方法,同时也允许 xdg-shell 客户端表明其更倾向于使用客户端还是服务器端装饰。

XdgDecorationManagerV1 对应于 Wayland 接口zxdg_decoration_manager_v1 。

要在合成器中提供该扩展的功能,请创建 XdgDecorationManagerV1 组件的实例,并将其添加到合成器支持的扩展列表中:

import QtWayland.Compositor

WaylandCompositor {
    // Xdg decoration manager assumes xdg-shell is being used
    XdgShell {
        onToplevelCreated: // ...
    }
    XdgDecorationManagerV1 {
        // Provide a hint to clients that support the extension they should use server-side
        // decorations.
        preferredMode: XdgToplevel.ServerSideDecoration
    }
}

另请参阅 QWaylandXdgToplevel::decorationMode 和《服务器端装饰合成器》。

属性文档

preferredMode : enumeration

该属性存储合成器首选的装饰模式。可能的取值包括:

常量描述
XdgToplevel.ClientSideDecoration客户端应绘制窗口装饰(默认)。
XdgToplevel.ServerSideDecoration合成器应绘制窗口装饰。

对于未指定偏好服务器端或客户端装饰的客户端,将使用此模式。

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