QtShellSurface QML Type
提供一种识别和调整曲面大小的简单方法。更多
| Import Statement: | import QtWayland.Compositor.QtShell |
| Since: | Qt 6.3 |
属性
- active : bool
- capabilities : enum
- frameMarginBottom : int
- frameMarginLeft : int
- frameMarginRight : int
- frameMarginTop : int
- maximumSize : size
- minimumSize : size
- surface : WaylandSurface
- windowFlags : int
- windowGeometry : rect
- windowPosition : point
- windowState : int
- windowTitle : string
信号
- void startMove()
- void startResize(enum edges)
方法
- void initialize(QtShell qtShell, WaylandSurface surface, WaylandResource resource)
- void requestWindowGeometry(int windowState, rect windowGeometry)
- void sendClose()
详细说明
该类型是QtShell 扩展的一部分,提供了一种通过窗口管理功能扩展现有WaylandSurface 功能的方法。
QtShellSurface 类型包含创建支持QtShell 扩展的合成器所需的核心功能。它可以直接使用,也可以通过QtShellChrome 类型使用,具体取决于合成器的需求。QtShellChrome 类型具有默认行为和方便的 API,用于处理 QtShellSurface 对象。
属性文档
active : bool
此属性表示曲面当前是否处于活动状态。
注: QtShellSurface 中没有阻止多个曲面同时处于激活状态的限制。这种逻辑必须由合成器本身实现,或使用QtShellChrome 类型,它会自动管理曲面的激活状态。
capabilities : enum
此属性包含合成器的功能。默认情况下,未启用任何特殊功能。
- QtShellSurface.InteractiveMove 客户端可以使用QWindow::startSystemMove() 触发服务器端的交互式移动操作。合成器将通过startMove() 信号收到通知。
- QtShellSurface.InteractiveResize 客户端可以使用QWindow::startSystemResize() 触发服务器端交互式调整大小操作。合成器将通过startResize() 信号收到通知。
frameMarginBottom : int
这将窗框边缘固定在表面之下。
frameMarginLeft : int
将窗框边距保持在曲面左侧。
frameMarginRight : int
这将窗框边距保持在曲面右侧。
frameMarginTop : int
这样就能将窗框边缘固定在表面之上。
maximumSize : size [read-only]
窗口的最大尺寸(如果客户端已指定)。否则为无效大小。
minimumSize : size [read-only]
窗口的最小尺寸(如果客户端已指定)。否则为无效大小。
surface : WaylandSurface [read-only]
该属性保存了与该QtShellSurface 相关的曲面。
windowFlags : int [read-only]
该属性用于保存QtShellSurface 的窗口标志。
windowGeometry : rect [read-only]
此属性用于保存外壳表面的窗口几何形状。
windowPosition : point
该属性用于保存外壳表面相对于输出的位置。
windowState : int [read-only]
该属性保存QtShellSurface 的窗口状态。
注意: 当调用requestWindowGeometry() 更新曲面的状态时,windowState 属性将不会被更新,直到客户端确认了状态的改变。
windowTitle : string [read-only]
该属性用于保存QtShellSurface 的窗口标题。
信号文档
void startMove()
客户端通过调用QWindow::startSystemMove() 请求在合成器中进行交互式移动操作。
注: 相应的处理程序是onStartMove 。
另请参阅 capabilities 。
void startResize(enum edges)
客户端通过调用QWindow::startSystemResize() 请求在合成器中进行交互式调整大小操作。
edges 提供了在调整大小过程中应移动窗口哪条边的信息。它是以下值的掩码:
- Qt.TopEdge
- Qt.LeftEdge
- Qt.RightEdge
- Qt.BottomEdge
注意: 相应的处理程序是onStartResize 。
另请参阅 capabilities 。
方法文档
void initialize(QtShell qtShell, WaylandSurface surface, WaylandResource resource)
初始化QtShellSurface ,将其与给定的qtShell 、surface 和resource 关联。
void requestWindowGeometry(int windowState, rect windowGeometry)
为QtShellSurface 请求新的windowState 和windowGeometry 。当客户端确认请求后,状态和几何图形将被更新(此时可以认为曲面缓冲区的大小已根据需要进行了调整)。
void sendClose()
要求客户端应用程序自行关闭。
© 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.