XdgToplevel QML Type
XdgToplevel 代表 xdg 表面中与顶级窗口相关的部分。更多内容...
| Import Statement: | import QtWayland.Compositor.XdgShell |
| In C++: | QWaylandXdgToplevel |
属性
- activated : bool
- appId : string
- decorationMode : enumeration
- fullscreen : bool
- maxSize : size
- maximized : bool
- minSize : size
- modal : bool
(since 6.8) - parentToplevel : XdgToplevel
- resizing : bool
- title : string
- xdgSurface : XdgSurface
方法
- void sendClose()
- int sendConfigure(size size, list<int> states)
- void sendFullscreen(size size)
- void sendMaximized(size size)
- void sendResizing(size size)
- void sendUnmaximized(size size)
- size sizeForResize(size size, point delta, uint edges)
详细说明
该类型属于XdgShell 扩展,提供了一种通过添加桌面风格窗口的特定功能来扩展XdgSurface 功能的方式。
它对应于 Wayland 接口xdg_toplevel 。
属性文档
activated : bool [read-only]
该属性表示顶级元素是否将自身绘制为具有输入焦点。
appId : string [read-only]
该属性存储了XdgToplevel 的应用程序ID。它对应于Qt中的desktopFileName 。
decorationMode : enumeration [read-only]
该属性保存了此顶级窗口的当前窗口装饰模式。
可能的取值为:
| 常量 | 描述 |
|---|---|
XdgToplevel.ServerSideDecoration | 合成器应绘制窗口装饰。 |
XdgToplevel.ClientSideDecoration | 应由客户端绘制窗口装饰。 |
另请参阅 XdgDecorationManagerV1 。
fullscreen : bool [read-only]
该属性表示客户端是否已确认应进入全屏模式。
maxSize : size [read-only]
该属性存储了客户端请求的XdgToplevel 的最大尺寸。
合成器可以忽略此值并请求更大的尺寸。
maximized : bool [read-only]
该属性表示客户端是否已确认应将其最大化。
minSize : size [read-only]
该属性存储了客户端请求的XdgToplevel 的最小尺寸。
合成器可以忽略此值,并请求较小的尺寸。
modal : bool [read-only, since 6.8]
该属性控制顶级窗口是否阻止其他窗口接收输入。
该属性在 Qt 6.8 中引入。
parentToplevel : XdgToplevel [read-only]
该属性保存了此XdgToplevel 的父级XdgToplevel 。
resizing : bool [read-only]
该属性用于指示客户端是否已确认其正在被调整大小。
title : string [read-only]
该房产被授予“XdgToplevel ”称号。
xdgSurface : XdgSurface [read-only]
该属性存储了此XdgToplevel 的XdgSurface 。
方法文档
void sendClose()
向客户端发送一个关闭事件。客户端可以选择忽略该事件。
int sendConfigure(size size, list<int> states)
向客户端发送一个配置事件。size 包含画面的像素尺寸。尺寸为零表示客户端可以自行决定尺寸。
states 的可能取值为:
| 常量 | 描述 |
|---|---|
XdgToplevel.MaximizedState | 表面处于最大化状态 |
XdgToplevel.FullscreenState | 画布处于全屏模式 |
XdgToplevel.ResizingState | 正在调整表面大小 |
XdgToplevel.ActivatedState | 该显示区域现已处于活动状态 |
void sendFullscreen(size size)
便于在设置为全屏状态时发送配置事件,同时移除了最大化及调整大小的功能。激活状态保持不变。
size 是窗口的新尺寸。
另请参阅 sendUnmaximized 。
void sendMaximized(size size)
便于发送一个配置事件,其中“最大化”状态被设置,而“全屏”和“调整大小”状态被移除。激活状态保持不变。
size 是窗口的新尺寸。
void sendResizing(size size)
便于发送一个配置事件,其中设置了调整大小的状态,并移除了最大化及全屏状态。激活状态保持不变。
size 是窗口的新尺寸。
void sendUnmaximized(size size)
用于发送配置事件的便捷方法,其中已移除“最大化”、“全屏”和“调整大小”这三种状态,同时还移除了“全屏”和“调整大小”状态。而“激活”状态则保持其当前状态不变。
size 是窗口的新尺寸。如果size 为零,则由客户端决定尺寸。
size sizeForResize(size size, point delta, uint edges)
在已知当前size 、delta 以及拖曳过程中处于活动状态的edges 的情况下,便于计算新尺寸。
© 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.