XdgShell QML Type

为桌面风格的用户界面提供扩展。更多

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

信号

方法

  • void ping(WaylandClient client)

详细说明

XdgShell 扩展提供了一种将XdgToplevelXdgPopup 与常规 Wayland 表面相关联的方法。通过XdgToplevel 界面,客户端可以请求调整曲面的大小、移动等。

XdgShell 与 Wayland 界面xdg_shell 相对应。

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

import QtWayland.Compositor.XdgShell

WaylandCompositor {
    XdgShell {
        // ...
    }
}

信号文档

pong(int serial)

当客户端以串行方式(serial )响应 ping 事件时,就会发出该信号。

注: 相应的处理程序是onPong

另请参阅 ping() 。


popupCreated(XdgPopup popup, XdgSurface xdgSurface)

当客户端创建了xdg_popup 时,会发出该信号。常见的用例是让该信号的处理程序实例化ShellSurfaceItemWaylandQuickItem ,以便在QtQuick 场景中显示popup

xdgSurface 是 的角色对象。XdgSurface popup

注: 相应的处理程序是onPopupCreated


toplevelCreated(XdgToplevel toplevel, XdgSurface xdgSurface)

该信号在客户端创建了xdg_toplevel 时发出。常见用例是让该信号的处理程序实例化ShellSurfaceItemWaylandQuickItem ,以便在QtQuick 场景中显示toplevel

xdgSurface 是 的角色对象。XdgSurface toplevel

注: 相应的处理程序是onToplevelCreated


xdgSurfaceCreated(XdgSurface xdgSurface)

该信号在客户端创建了xdg_surface 时发出。请注意,xdgSurface 没有被映射,也就是说,根据xdg-shell 协议,在收到角色对象之前,它不应该被显示。

注: 相应的处理程序是onXdgSurfaceCreated

另请参阅 toplevelCreated() 和popupCreated()。


方法文档

void ping(WaylandClient client)

client 发送 ping 事件。如果客户端回复了该事件,将发出pong 信号。


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