QtShellSurface QML Type

提供一种识别和调整曲面大小的简单方法。更多

Import Statement: import QtWayland.Compositor.QtShell
Since: Qt 6.3

属性

信号

方法

详细说明

该类型是QtShell 扩展的一部分,提供了一种通过窗口管理功能扩展现有WaylandSurface 功能的方法。

QtShellSurface 类型包含创建支持QtShell 扩展的合成器所需的核心功能。它可以直接使用,也可以通过QtShellChrome 类型使用,具体取决于合成器的需求。QtShellChrome 类型具有默认行为和方便的 API,用于处理 QtShellSurface 对象。

属性文档

active : bool

该属性表示曲面当前是否处于活动状态。

注意: QtShellSurface 中没有任何限制阻止多个表面同时处于活动状态。这种逻辑必须由合成器本身实现,或使用QtShellChrome 类型,它会自动管理曲面的激活状态。


capabilities : enum

此属性包含合成器的功能。默认情况下,不会启用任何特殊功能。


frameMarginBottom : int

.InteractiveResize(交互式调整大小):这将保持窗口边框边距低于表面。


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 ,将其与给定的qtShellsurfaceresource 关联。


void requestWindowGeometry(int windowState, rect windowGeometry)

QtShellSurface 请求一个新的windowStatewindowGeometry 。当客户端确认请求后,将更新状态和几何图形(此时可以认为曲面的缓冲区已根据需要进行了调整)。


void sendClose()

请求关闭客户端程序。


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