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 扩展的一部分,提供了一种方法来扩展XdgSurface 的功能,为 xdg 表面提供桌面风格菜单的特定功能。
它与 Wayland 界面xdg_popup 相对应。
属性文档
anchorEdges : enumeration [read-only]
此属性保存子曲面应相对于锚点矩形放置的边缘集。如果在一个方向上没有指定边缘,锚点应位于边缘之间的中心。
可能的值有
| 常量 | 描述 |
|---|---|
Qt.TopEdge | 矩形的上边缘。 |
Qt.LeftEdge | 矩形的左边缘 |
Qt.RightEdge | 矩形的右边缘 |
Qt.BottomEdge | 矩形的下边缘 |
anchorRect : rect [read-only]
相对于父窗口几何图形的锚点矩形,子表面应相对于该矩形放置。
configuredGeometry : rect [read-only]
配置事件中弹出窗口的几何尺寸。相对于父表面的左上角。
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.