QWaylandWlShellSurface Class

The QWaylandWlShellSurface class provides desktop-style compositor-specific features to a surface. More...

Header: #include <QWaylandWlShellSurface>
CMake: find_package(Qt6 REQUIRED COMPONENTS Waylandcompositor)
target_link_libraries(mytarget PRIVATE Qt6::Waylandcompositor)
qmake: QT += waylandcompositor
Since: Qt 5.8
Instantiated By: WlShellSurface
Inherits: QWaylandShellSurfaceTemplate

Public Types

enum FullScreenMethod { DefaultFullScreen, ScaleFullScreen, DriverFullScreen, FillFullScreen }
enum ResizeEdge { NoneEdge, TopEdge, BottomEdge, LeftEdge, TopLeftEdge, …, BottomRightEdge }


Public Functions

QWaylandWlShellSurface(QWaylandWlShell *shell, QWaylandSurface *surface, const QWaylandResource &res)
virtual ~QWaylandWlShellSurface() override
QString className() const
QQmlListProperty<QObject> data()
void initialize(QWaylandWlShell *shell, QWaylandSurface *surface, const QWaylandResource &resource)
void sendConfigure(const QSize &size, QWaylandWlShellSurface::ResizeEdge edges)
void sendPopupDone()
QWaylandWlShell *shell() const
QSize sizeForResize(const QSizeF &size, const QPointF &delta, QWaylandWlShellSurface::ResizeEdge edges)
QWaylandSurface *surface() const
QString title() const

Reimplemented Public Functions

virtual QWaylandQuickShellIntegration *createIntegration(QWaylandQuickShellSurfaceItem *item) override
virtual Qt::WindowType windowType() const override

Public Slots

void ping()


void classNameChanged()
void pong()
void setDefaultToplevel()
void setFullScreen(QWaylandWlShellSurface::FullScreenMethod method, uint framerate, QWaylandOutput *output)
void setMaximized(QWaylandOutput *output)
void setPopup(QWaylandSeat *seat, QWaylandSurface *parentSurface, const QPoint &relativeToParent)
void setTransient(QWaylandSurface *parentSurface, const QPoint &relativeToParent, bool inactive)
void shellChanged()
void startMove(QWaylandSeat *seat)
void startResize(QWaylandSeat *seat, QWaylandWlShellSurface::ResizeEdge edges)
void surfaceChanged()
void titleChanged()

Static Public Members

void appendFunction(QQmlListProperty<QObject> *list, QObject *object)
QObject *atFunction(QQmlListProperty<QObject> *list, qsizetype index)
void clearFunction(QQmlListProperty<QObject> *list)
qsizetype countFunction(QQmlListProperty<QObject> *list)
QWaylandWlShellSurface *fromResource(wl_resource *resource)
const struct wl_interface *interface()
QWaylandSurfaceRole *role()

Detailed Description

This class is part of the QWaylandWlShell extension and provides a way to extend the functionality of an existing QWaylandSurface with features specific to desktop-style compositors, such as resizing and moving the surface.

It corresponds to the Wayland interface wl_shell_surface.

Member Type Documentation

enum QWaylandWlShellSurface::FullScreenMethod

enum QWaylandWlShellSurface::ResizeEdge

This enum type provides a way to specify an edge or corner of the surface.

QWaylandWlShellSurface::NoneEdge0No edge.
QWaylandWlShellSurface::TopEdge1The top edge.
QWaylandWlShellSurface::BottomEdge2The bottom edge.
QWaylandWlShellSurface::LeftEdge4The left edge.
QWaylandWlShellSurface::TopLeftEdge5The top left corner.
QWaylandWlShellSurface::BottomLeftEdge6The bottom left corner.
QWaylandWlShellSurface::RightEdge8The right edge.
QWaylandWlShellSurface::TopRightEdge9The top right corner.
QWaylandWlShellSurface::BottomRightEdge10The bottom right corner.

Property Documentation

[read-only] className : const QString

This property holds the class name of the QWaylandWlShellSurface.

Access functions:

QString className() const

Notifier signal:

void classNameChanged()

[read-only] shell : QWaylandWlShell* const

This property holds the shell associated with this QWaylandWlShellSurface.

Access functions:

QWaylandWlShell *shell() const

Notifier signal:

void shellChanged()

[read-only] surface : QWaylandSurface* const

This property holds the surface associated with this QWaylandWlShellSurface.

Access functions:

QWaylandSurface *surface() const

Notifier signal:

void surfaceChanged()

[read-only] title : const QString

This property holds the title of the QWaylandWlShellSurface.

Access functions:

QString title() const

Notifier signal:

void titleChanged()

Member Function Documentation


Constructs a QWaylandWlShellSurface.

QWaylandWlShellSurface::QWaylandWlShellSurface(QWaylandWlShell *shell, QWaylandSurface *surface, const QWaylandResource &res)

Constructs a QWaylandWlShellSurface for surface and initializes it with the given shell and resource res.

[override virtual] QWaylandWlShellSurface::~QWaylandWlShellSurface()

Destroys the instance of QWaylandWlShellSurface. The destructor is virtual.

[static] void QWaylandWlShellSurface::appendFunction(QQmlListProperty<QObject> *list, QObject *object)

[static] QObject *QWaylandWlShellSurface::atFunction(QQmlListProperty<QObject> *list, qsizetype index)

[static] void QWaylandWlShellSurface::clearFunction(QQmlListProperty<QObject> *list)

[static] qsizetype QWaylandWlShellSurface::countFunction(QQmlListProperty<QObject> *list)

[override virtual] QWaylandQuickShellIntegration *QWaylandWlShellSurface::createIntegration(QWaylandQuickShellSurfaceItem *item)

QQmlListProperty<QObject> QWaylandWlShellSurface::data()

[static] QWaylandWlShellSurface *QWaylandWlShellSurface::fromResource(wl_resource *resource)

Returns the QWaylandWlShellSurface object associated with the given resource, or null if no such object exists.

[invokable] void QWaylandWlShellSurface::initialize(QWaylandWlShell *shell, QWaylandSurface *surface, const QWaylandResource &resource)

Initializes the QWaylandWlShellSurface and associates it with the given shell, surface, and resource.

Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.

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

[slot] void QWaylandWlShellSurface::ping()

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

[signal] void QWaylandWlShellSurface::pong()

[static] QWaylandSurfaceRole *QWaylandWlShellSurface::role()

[invokable] void QWaylandWlShellSurface::sendConfigure(const QSize &size, QWaylandWlShellSurface::ResizeEdge edges)

Sends a configure event to the client, suggesting that it resize its surface to the provided size. The edges provide a hint about how the surface was resized.

Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.

[invokable] void QWaylandWlShellSurface::sendPopupDone()

Sends a popup_done event to the client to indicate that the user has clicked somewhere outside the client's surfaces.

Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.

[signal] void QWaylandWlShellSurface::setDefaultToplevel()

[signal] void QWaylandWlShellSurface::setFullScreen(QWaylandWlShellSurface::FullScreenMethod method, uint framerate, QWaylandOutput *output)

[signal] void QWaylandWlShellSurface::setMaximized(QWaylandOutput *output)

[signal] void QWaylandWlShellSurface::setPopup(QWaylandSeat *seat, QWaylandSurface *parentSurface, const QPoint &relativeToParent)

[signal] void QWaylandWlShellSurface::setTransient(QWaylandSurface *parentSurface, const QPoint &relativeToParent, bool inactive)

[invokable] QSize QWaylandWlShellSurface::sizeForResize(const QSizeF &size, const QPointF &delta, QWaylandWlShellSurface::ResizeEdge edges)

[signal] void QWaylandWlShellSurface::startMove(QWaylandSeat *seat)

[signal] void QWaylandWlShellSurface::startResize(QWaylandSeat *seat, QWaylandWlShellSurface::ResizeEdge edges)

[override virtual] Qt::WindowType QWaylandWlShellSurface::windowType() const

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