QWaylandCompositorExtension Class

QWaylandCompositorExtension is the base class for compositor extensions. More...

Header: #include <QWaylandCompositorExtension>
CMake: find_package(Qt6 REQUIRED COMPONENTS Waylandcompositor)
target_link_libraries(mytarget PRIVATE Qt6::Waylandcompositor)
qmake: QT += waylandcompositor
Since: Qt 5.8
Inherits: QWaylandObject
Inherited By:

QWaylandCompositorExtensionTemplate and QWaylandShellSurface

Public Functions

QWaylandCompositorExtension(QWaylandObject *container)
QWaylandCompositorExtension()
QWaylandObject *extensionContainer() const
virtual const struct wl_interface *extensionInterface() const = 0
virtual void initialize()
void setExtensionContainer(QWaylandObject *container)

Detailed Description

QWaylandCompositorExtension is the base class for implementing Wayland extensions on the compositor-side of the connection. If no other extension container is explicitly set, it will automatically add itself to its parent object, granted that this inherits from QWaylandObject.

For example, for registering global extensions, you can inherit from QWaylandCompositorExtension and pass the QWaylandCompositor object as extension container.

See also QWaylandCompositorExtensionTemplate and Qt Wayland Compositor Examples - Custom Shell.

Member Function Documentation

QWaylandCompositorExtension::QWaylandCompositorExtension(QWaylandObject *container)

Creates a QWaylandCompositorExtension and adds it to the extension container. The container does not become the parent of the QWaylandCompositorExtension.

The extension adds itself to container later, when initialize() is called. For this to happen automatically, an event loop must be running in the current thread.

The QWaylandCompositorExtension will remove itself again when it is destroyed.

QWaylandCompositorExtension::QWaylandCompositorExtension()

Creates a QWaylandCompositorExtension with no container.

See also setExtensionContainer().

QWaylandObject *QWaylandCompositorExtension::extensionContainer() const

Returns the extension container for this QWaylandCompositorExtension or null if none has been set.

See also setExtensionContainer().

[pure virtual] const struct wl_interface *QWaylandCompositorExtension::extensionInterface() const

A pure virtual function which should be reimplemented to return the wl_interface which corresponds to this QWaylandCompositorExtension.

[virtual] void QWaylandCompositorExtension::initialize()

Initializes the QWaylandCompositorExtension. The default implementation adopts the parent object as extension container if none has been set, and if the parent inherits from QWaylandObject. The default implementation also adds the QWaylandCompositorExtension to the list of extensions managed by the extension container.

Override this function in subclasses to provide custom initialization code.

void QWaylandCompositorExtension::setExtensionContainer(QWaylandObject *container)

Sets the extension container for this QWaylandCompositorExtension to container. This must be called before initialize() and cannot be changed once the QWaylandCompositorExtension has been initialized.

See also extensionContainer().

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