本页内容

QWaylandXdgPopup Class

QWaylandXdgPopup 类表示 xdg 表面中与弹出窗口相关的部分。更多内容...

头文件: #include <QWaylandXdgPopup>
CMake: find_package(Qt6 REQUIRED COMPONENTS WaylandCompositor)
target_link_libraries(mytarget PRIVATE Qt6::WaylandCompositor)
qmake: QT += waylandcompositor
在 QML 中: XdgPopup
继承自: QObject

属性

公共函数

Qt::Edges anchorEdges() const
QRect anchorRect() const
QRect configuredGeometry() const
Qt::Orientations flipConstraints() const
Qt::Edges gravityEdges() const
QPoint offset() const
QWaylandXdgSurface *parentXdgSurface() const
QSize positionerSize() const
Qt::Orientations resizeConstraints() const
uint sendConfigure(const QRect &geometry)
void sendPopupDone()
Qt::Orientations slideConstraints() const
QPoint unconstrainedPosition() const
QWaylandXdgSurface *xdgSurface() const

信号

静态公共成员

QWaylandSurfaceRole *role()

详细说明

该类是QWaylandXdgShell 扩展的一部分,提供了一种方法来扩展QWaylandXdgSurface 的功能,使其具备针对xdg表面桌面风格菜单的特定功能。

它对应于 Wayland 接口xdg_popup 。

属性文档

[read-only] anchorEdges : const Qt::Edges

返回锚点矩形上的一组边,子曲面应相对于这些边进行定位。如果某个方向未指定任何边,则锚点应位于这些边的中间位置。

访问函数:

Qt::Edges anchorEdges() const

[read-only] anchorRect : const QRect

返回子表面应相对于其父窗口几何形状放置的锚点矩形。

访问函数:

QRect anchorRect() const

[read-only] configuredGeometry : QRect

弹出窗口在 configure 事件中接收到的窗口几何信息。以父级表面的左上角为基准。

访问函数:

QRect configuredGeometry() const

通知信号:

void configuredGeometryChanged()

[read-only] flipConstraints : const Qt::Orientations

该属性用于指定子元素应以何种方向旋转,以便适应屏幕。

访问函数:

Qt::Orientations flipConstraints() const

[read-only] gravityEdges : const Qt::Edges

指定相对于锚点,表面应朝哪个方向定位。

访问函数:

Qt::Edges gravityEdges() const

[read-only] offset : const QPoint

返回相对于锚点矩形上锚点位置以及曲面上的锚点位置的曲面位置。

访问函数:

QPoint offset() const

[read-only] parentXdgSurface : QWaylandXdgSurface* const

该属性存储与该QWaylandXdgPopup 的父对象关联的QWaylandXdgSurface 。

访问函数:

QWaylandXdgSurface *parentXdgSurface() const

[read-only] positionerSize : const QSize

返回定位器对象为窗口几何形状请求的大小。

访问函数:

QSize positionerSize() const

[read-only] resizeConstraints : const Qt::Orientations

该属性用于指定子元素应调整大小的方向,以便适应屏幕。

访问函数:

Qt::Orientations resizeConstraints() const

[read-only] slideConstraints : const Qt::Orientations

该属性用于指定子元素应沿哪些方向滑动以适应屏幕。

访问函数:

Qt::Orientations slideConstraints() const

[read-only] unconstrainedPosition : const QPoint

如果该表面未受约束,则其相对于父窗口几何形状的位置。即,当该表面未被移动以适应屏幕内部或类似情况时。

访问函数:

QPoint unconstrainedPosition() const

[read-only] xdgSurface : QWaylandXdgSurface* const

该属性存储与该QWaylandXdgPopup 关联的QWaylandXdgSurface 。

访问函数:

QWaylandXdgSurface *xdgSurface() const

成员函数文档

[static] QWaylandSurfaceRole *QWaylandXdgPopup::role()

返回 QWaylandPopup 的表面角色。

[invokable] uint QWaylandXdgPopup::sendConfigure(const QRect &geometry)

向客户端发送一个配置事件。geometry 包含相对于父级表面窗口几何形状左上角的窗口几何形状。

这也会隐式地向相应的QWaylandXdgSurface 发送一个配置事件。

注意:此 函数可通过元对象系统和 QML 调用。参见Q_INVOKABLE 。

[invokable] void QWaylandXdgPopup::sendPopupDone()

关闭弹出窗口。根据xdg-shell 协议,这应使客户端销毁该弹出窗口。

注意:此 函数可通过元对象系统及 QML 调用。参见Q_INVOKABLE 。

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