QWaylandXdgShell Class

The QWaylandXdgShell class is an extension for desktop-style user interfaces. More...

Header: #include <QWaylandXdgShell>
CMake: find_package(Qt6 REQUIRED COMPONENTS WaylandCompositor)
target_link_libraries(mytarget PRIVATE Qt6::WaylandCompositor)
qmake: QT += waylandcompositor
In QML: XdgShell
Inherits: QWaylandShellTemplate

Public Functions

QWaylandXdgShell()
QWaylandXdgShell(QWaylandCompositor *compositor)

Reimplemented Public Functions

virtual void initialize() override

Public Slots

uint ping(QWaylandClient *client)

Signals

void pong(uint serial)
void popupCreated(QWaylandXdgPopup *popup, QWaylandXdgSurface *xdgSurface)
void toplevelCreated(QWaylandXdgToplevel *toplevel, QWaylandXdgSurface *xdgSurface)
void xdgSurfaceCreated(QWaylandXdgSurface *xdgSurface)

Static Public Members

const struct wl_interface *interface()

Detailed Description

The QWaylandXdgShell extension provides a way to associate a QWaylandXdgToplevel or QWaylandXdgPopup with a regular Wayland surface. Using the QWaylandXdgToplevel interface, the client can request that the surface is resized, moved, and so on.

QWaylandXdgShell corresponds to the Wayland interface, xdg_shell.

Member Function Documentation

[explicit] QWaylandXdgShell::QWaylandXdgShell()

Constructs a QWaylandXdgShell object.

[explicit] QWaylandXdgShell::QWaylandXdgShell(QWaylandCompositor *compositor)

Constructs a QWaylandXdgShell object for the provided compositor.

[override virtual] void QWaylandXdgShell::initialize()

Reimplements: QWaylandCompositorExtension::initialize().

Initializes the shell extension.

[static] const struct wl_interface *QWaylandXdgShell::interface()

Returns the Wayland interface for the QWaylandXdgShell.

[slot] uint QWaylandXdgShell::ping(QWaylandClient *client)

Sends a ping event to client. If the client replies to the event the pong signal will be emitted.

[signal] void QWaylandXdgShell::pong(uint serial)

This signal is emitted when the client has responded to a ping event with serial, serial.

See also QWaylandXdgShell::ping().

[signal] void QWaylandXdgShell::popupCreated(QWaylandXdgPopup *popup, QWaylandXdgSurface *xdgSurface)

This signal is emitted when the client has created a xdg_popup. A common use case is to let the handler of this signal instantiate a QWaylandShellSurfaceItem or QWaylandQuickItem for displaying popup in a QtQuick scene.

xdgSurface is the XdgSurface popup is the role object for.

[signal] void QWaylandXdgShell::toplevelCreated(QWaylandXdgToplevel *toplevel, QWaylandXdgSurface *xdgSurface)

This signal is emitted when the client has created a xdg_toplevel. A common use case is to let the handler of this signal instantiate a QWaylandShellSurfaceItem or QWaylandQuickItem for displaying toplevel in a QtQuick scene.

xdgSurface is the XdgSurface toplevel is the role object for.

[signal] void QWaylandXdgShell::xdgSurfaceCreated(QWaylandXdgSurface *xdgSurface)

This signal is emitted when the client has created a xdg_surface. Note that xdgSurface is not mapped, i.e. according to the xdg-shell protocol it should not be displayed, until it has received a role object.

See also toplevelCreated() and popupCreated().