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 maxSize)
- void sendUnmaximized(size size)
- size sizeForResize(size size, point delta, uint edges)
详细说明
该类型是XdgShell 扩展的一部分,提供了一种扩展XdgSurface 功能的方法,具有桌面风格窗口的特定功能。
它与 Wayland 接口xdg_toplevel 相对应。
属性文档
activated : bool [read-only]
该属性表示 toplevel 是否将自己绘制为输入焦点。
appId : string [read-only]
该属性包含XdgToplevel 的应用程序 ID。
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]
此属性表示 toplevel 是否阻止其他窗口接收输入。
该属性在 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 包含曲面的像素大小。尺寸为 0 表示客户端可以自由决定尺寸。已知的states 在 XdgToplevel::State 中枚举。
void sendFullscreen(size size)
方便发送已设置全屏状态、最大化和调整大小的配置事件。激活状态保持当前状态。
size 是窗口的新大小。
另请参阅 sendUnmaximized 。
void sendMaximized(size size)
方便发送已设置最大化状态、取消全屏和调整大小的配置事件。激活状态保持当前状态。
size 是窗口的新大小。
void sendResizing(size maxSize)
方便发送已设置大小调整状态、已移除最大化和全屏状态的配置事件。激活状态保持当前状态。
maxSize 是窗口的新大小。
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.