QWaylandXdgPopup Class

QWaylandXdgPopup 类表示 xdg 表面的弹出特定部分。更多

Header: #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 : const QRect

配置事件中弹出窗口的几何尺寸。相对于父表面的左上角。

访问功能:

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

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