QWaylandCompositorExtension Class

QWaylandCompositorExtension is the base class for compositor extensions. 更多...

头: #include <QWaylandCompositorExtension>
CMake: find_package(Qt6 REQUIRED COMPONENTS WaylandCompositor)
target_link_libraries(mytarget PRIVATE Qt6::WaylandCompositor)
qmake: QT += waylandcompositor
继承: QWaylandObject
继承者: QWaylandCompositorExtensionTemplate and QWaylandShellSurface

公共函数

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

详细描述

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.

另请参阅 QWaylandCompositorExtensionTemplate and 自定义 Shell .

成员函数文档编制

QWaylandCompositorExtension:: QWaylandCompositorExtension ()

Creates a QWaylandCompositorExtension with no container.

另请参阅 setExtensionContainer ().

QWaylandCompositorExtension:: QWaylandCompositorExtension ( QWaylandObject * container )

Creates a QWaylandCompositorExtension and adds it to the extension containercontainer 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.

QWaylandObject *QWaylandCompositorExtension:: extensionContainer () const

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

另请参阅 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 .

[虚拟] void QWaylandCompositorExtension:: initialize ()

初始化 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.

另请参阅 extensionContainer ().