XdgShell QML Type
提供了一个用于桌面风格用户界面的扩展。更多...
| Import Statement: | import QtWayland.Compositor.XdgShell |
| In C++: | QWaylandXdgShell |
信号
- pong(int serial)
- popupCreated(XdgPopup popup, XdgSurface xdgSurface)
- toplevelCreated(XdgToplevel toplevel, XdgSurface xdgSurface)
- xdgSurfaceCreated(XdgSurface xdgSurface)
方法
- void ping(WaylandClient client)
详细说明
XdgShell 扩展提供了一种将XdgToplevel 或XdgPopup 与常规 Wayland 画布关联的方法。通过XdgToplevel 接口,客户端可以请求对画布进行调整大小、移动等操作。
XdgShell 对应于 Wayland 接口xdg_shell 。
要在合成器中提供 shell 扩展的功能,请创建 XdgShell 组件的实例,并将其添加到合成器支持的扩展列表中:
import QtWayland.Compositor.XdgShell
WaylandCompositor {
XdgShell {
// ...
}
}Signal 文档
pong(int serial)
当客户端对 ping 事件以串行数据serial 进行响应时,会发出此信号。
注意: 相应的处理程序 为onPong 。
另请参阅 ping()。
popupCreated(XdgPopup popup, XdgSurface xdgSurface)
当客户端创建了xdg_popup 时,会发出此信号。一个常见的用例是让该信号的处理程序实例化ShellSurfaceItem 或WaylandQuickItem ,以便在QtQuick 场景中显示popup 。
xdgSurface XdgSurface 即 所对应的角色对象。popup
注意: 对应的处理程序 是onPopupCreated 。
toplevelCreated(XdgToplevel toplevel, XdgSurface xdgSurface)
当客户端创建了xdg_toplevel 时,会发出此信号。一个常见的用例是让该信号的处理程序实例化ShellSurfaceItem 或WaylandQuickItem ,以便在QtQuick 场景中显示toplevel 。
xdgSurface XdgSurface 是 所对应的角色对象。toplevel
注意: 对应的处理程序 是onToplevelCreated 。
xdgSurfaceCreated(XdgSurface xdgSurface)
当客户端创建了xdg_surface 时,会发出此信号。请注意,xdgSurface 尚未被映射,即根据xdg-shell 协议,在收到角色对象之前,它不应被显示。
注意: 相应的处理程序 是onXdgSurfaceCreated 。
另请参阅 toplevelCreated() 和popupCreated()。
方法文档
void ping(WaylandClient client)
向client 发送一个ping事件。如果客户端对该事件作出响应,则会触发pong 信号。
© 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.