- Qt 6.9
- Qt Wayland Compositor
- <QWaylandQuickExtension> - Qt Wayland Compositor Qt Quick Extension Macro Declarations
- Qt Wayland Compositor | Commercial or GPLv3

# <QWaylandQuickExtension> - Qt Wayland Compositor Qt Quick Extension Macro Declarations

The <QWaylandQuickExtension> header file includes macros for creating Qt Quick types that correspond to subclasses of QWaylandCompositorExtension and QWaylandObject. More...

Header: | `#include <QWaylandQuickExtension>`

- Deprecated members

## Macros

| Q_COMPOSITOR_DECLARE_QUICK_EXTENSION_CLASS(className)
| Q_COMPOSITOR_DECLARE_QUICK_EXTENSION_CONTAINER_CLASS(className)
`(since 6.8)` | Q_COMPOSITOR_DECLARE_QUICK_EXTENSION_NAMED_ELEMENT(className, QmlType)

## Detailed Description

If you are creating extensions to Qt Wayland Compositor, the macros in the QWaylandQuickExtension header may be a useful alternative to manually implementing the required parts for each class.

See also Custom Shell.

## Macro Documentation

### Q_COMPOSITOR_DECLARE_QUICK_EXTENSION_CLASS(className)

This macro can be used to define a Qt Quick class based on a Wayland extension. It defines a new class which inherits from className and which suffixes the name with "QuickExtension".

The class should be a subclass of QWaylandCompositorExtension, and QWaylandCompositorExtension::initialize() will be called automatically. The type must be manually registered in Qt Quick using qmlRegisterType().

See also Q_COMPOSITOR_DECLARE_QUICK_EXTENSION_NAMED_ELEMENT.

### Q_COMPOSITOR_DECLARE_QUICK_EXTENSION_CONTAINER_CLASS(className)

This macro can be used to define a Qt Quick class intended to contain Wayland extensions. It

It defines a new class which inherits from className and which suffixes the name with "QuickExtensionContainer". The class given by className should inherit from QWaylandObject, and the new class will have an `extensions` property which manages the extensions by calling addExtension() and removeExtension() in the base class.

The type must be manually registered in Qt Quick using qmlRegisterType().

### `[since 6.8]` Q_COMPOSITOR_DECLARE_QUICK_EXTENSION_NAMED_ELEMENT(className, QmlType)

This macro can be used to define a Qt Quick class based on a Wayland extension. It defines a new class which inherits from className and which suffixes the name with "QuickExtension".

The macro works the same as Q_COMPOSITOR_DECLARE_QUICK_EXTENSION_CLASS, but will also automatically register the new type as QmlType in the current QML module.

This macro was introduced in Qt 6.8.