XdgPopup QML Type
XdgPopup 代表 xdg 表面中与弹出窗口相关的部分。更多内容...
| Import Statement: | import QtWayland.Compositor.XdgShell |
| In C++: | QWaylandXdgPopup |
属性
- anchorEdges : enumeration
- anchorRect : rect
- configuredGeometry : rect
- flipConstraints : enumeration
- gravityEdges : rect
- offset : point
- parentXdgSurface : XdgSurface
- positionerSize : size
- resizeConstraints : enumeration
- slideConstraints : enumeration
- unconstrainedPosition : point
- xdgSurface : XdgSurface
方法
- int sendConfigure(rect geometry)
- void sendPopupDone()
详细说明
该类型属于XdgShell 扩展的一部分,提供了一种方式,用于通过为 xdg 表面添加桌面风格菜单的特定功能,来扩展XdgSurface 的功能。
它对应于 Wayland 接口xdg_popup 。
属性文档
anchorEdges : enumeration [read-only]
该属性存储了锚点矩形上的一组边,子表面应相对于这些边进行定位。如果某个方向未指定任何边,则锚点应位于这些边的中间位置。
可能的取值包括:
| 常量 | 描述 |
|---|---|
Qt.TopEdge | 矩形的顶部边。 |
Qt.LeftEdge | 矩形的左边缘。 |
Qt.RightEdge | 矩形的右边。 |
Qt.BottomEdge | 矩形的底部边缘。 |
anchorRect : rect [read-only]
子表面应相对于父窗口几何形状的锚定矩形。
configuredGeometry : rect [read-only]
弹出窗口在 configure 事件中接收到的窗口几何信息。相对于父级表面的左上角。
flipConstraints : enumeration [read-only]
该属性用于指定子元素应以何种方向翻转,以便适应屏幕。
可能的取值:
| 常量 | 描述 |
|---|---|
Qt.Horizontal | 水平 |
Qt.Vertical | 垂直 |
gravityEdges : rect [read-only]
指定相对于锚点,曲面应朝哪个方向定位。
可能的取值为:
| 常量 | 说明 |
|---|---|
Qt.TopEdge | 表面应向屏幕顶部滑动。 |
Qt.LeftEdge | 表面应向屏幕左侧滑动。 |
Qt.RightEdge | 平面应向屏幕右侧滑动。 |
Qt.BottomEdge | 该平面应向屏幕底部滑动。 |
offset : point [read-only]
相对于锚点在锚点矩形上的位置以及锚点在表面上的位置。
parentXdgSurface : XdgSurface [read-only]
该属性保存了与该XdgPopup 的父级相关的XdgSurface 。
positionerSize : size [read-only]
定位器对象为窗口几何形状请求的尺寸。
resizeConstraints : enumeration [read-only]
该属性用于指定子元素应调整大小以适应屏幕的各个方向。
可能的取值:
| 常量 | 描述 |
|---|---|
Qt.Horizontal | 水平 |
Qt.Vertical | 垂直 |
slideConstraints : enumeration [read-only]
该属性用于指定子元素应以何种方向滑动,以便适配屏幕。
可能的取值:
| 常量 | 描述 |
|---|---|
Qt.Horizontal | 水平 |
Qt.Vertical | 垂直 |
unconstrainedPosition : point [read-only]
如果该表面未受约束,则其相对于父窗口几何形状的位置。即,当该表面未被移动以适应屏幕内部或类似情况时。
xdgSurface : XdgSurface [read-only]
该属性存储与该XdgPopup 关联的XdgSurface 。
方法文档
int sendConfigure(rect geometry)
向客户端发送一个配置事件。geometry 包含相对于父级绘制区域窗口几何形状左上角的窗口几何形状。
这也会隐式地向相应的 `XdgSurface ` 发送一个配置事件。
void sendPopupDone()
关闭弹出窗口。根据xdg-shell 协议,此操作应促使客户端销毁该弹出窗口。
© 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.