The QWaylandCompositor class manages the Wayland display server. 更多...
| 頭: | #include <QWaylandCompositor> |
| CMake: |
find_package(Qt6 REQUIRED COMPONENTS WaylandCompositor)
target_link_libraries(mytarget PRIVATE Qt6::WaylandCompositor) |
| qmake: | QT += waylandcompositor |
| 實例化: | WaylandCompositor |
| 繼承: | QWaylandObject |
|
|
| QWaylandCompositor (QObject * parent = nullptr) | |
| virtual | ~QWaylandCompositor () override |
| void | addSocketDescriptor (int fd ) |
| QVector<QWaylandCompositor::ShmFormat> | additionalShmFormats () const |
| virtual void | create () |
| QWaylandOutput * | defaultOutput () const |
| QWaylandSeat * | defaultSeat () const |
| void | destroyClient (QWaylandClient * client ) |
| void | destroyClientForSurface (QWaylandSurface * surface ) |
| virtual void | grabSurface (QWaylandSurfaceGrabber * grabber , const QWaylandBufferRef & buffer ) |
| bool | isCreated () const |
| QWaylandOutput * | outputFor (QWindow * window ) const |
| bool | retainedSelectionEnabled () const |
| QWaylandSeat * | seatFor (QInputEvent * inputEvent ) |
| void | setAdditionalShmFormats (const QVector<QWaylandCompositor::ShmFormat> & additionalShmFormats ) |
| void | setDefaultOutput (QWaylandOutput * output ) |
| void | setRetainedSelectionEnabled (bool enabled ) |
| void | setSocketName (const QByteArray & name ) |
| void | setUseHardwareIntegrationExtension (bool 使用 ) |
| QByteArray | socketName () const |
| bool | useHardwareIntegrationExtension () const |
| void | additionalShmFormatsChanged () |
| void | createdChanged () |
| void | defaultOutputChanged () |
| void | defaultSeatChanged (QWaylandSeat * newDevice , QWaylandSeat * oldDevice ) |
| void | retainedSelectionChanged (bool retainedSelection ) |
| void | socketNameChanged (const QByteArray & socketName ) |
| void | surfaceCreated (QWaylandSurface * surface ) |
| void | surfaceRequested (QWaylandClient * client , uint id , int version ) |
| void | useHardwareIntegrationExtensionChanged () |
The QWaylandCompositor manages the connections to the clients, as well as the different outputs and seats .
Normally, a compositor application will have a single WaylandCompositor instance, which can have several outputs as children.
[since 6.0]
additionalShmFormats
:
QVector
<
ShmFormat
>
This property holds the list of additional wl_shm formats advertised as supported by the compositor.
By default, only the required ShmFormat_ARGB8888 and ShmFormat_XRGB8888 are listed and this list will empty.
This property must be set before the compositor is created . Subsequent changes will have no effect.
This property was introduced in Qt 6.0.
訪問函數:
| QVector<QWaylandCompositor::ShmFormat> | additionalShmFormats () const |
| void | setAdditionalShmFormats (const QVector<QWaylandCompositor::ShmFormat> & additionalShmFormats ) |
通知程序信號:
| void | additionalShmFormatsChanged () |
[read-only]
created
: const
bool
This property is true if QWaylandCompositor has been initialized, otherwise it's false.
訪問函數:
| bool | isCreated () const |
通知程序信號:
| void | createdChanged () |
This property contains the first in the list of outputs added to the QWaylandCompositor , or null if no outputs have been added.
Setting a new default output prepends it to the output list, making it the new default, but the previous default is not removed from the list. If the new default output was already in the list of outputs, it is moved to the beginning of the list.
訪問函數:
| QWaylandOutput * | defaultOutput () const |
| void | setDefaultOutput (QWaylandOutput * output ) |
通知程序信號:
| void | defaultOutputChanged () |
[read-only]
defaultSeat
:
QWaylandSeat
* const
This property contains the default seat for this QWaylandCompositor .
訪問函數:
| QWaylandSeat * | defaultSeat () const |
通知程序信號:
| void | defaultSeatChanged (QWaylandSeat * newDevice , QWaylandSeat * oldDevice ) |
This property holds whether retained selection is enabled.
訪問函數:
| bool | retainedSelectionEnabled () const |
| void | setRetainedSelectionEnabled (bool enabled ) |
通知程序信號:
| void | retainedSelectionChanged (bool retainedSelection ) |
This property holds the socket name used by QWaylandCompositor to communicate with clients. This must be set before the QWaylandCompositor is created .
If the socketName is empty (the default), the contents of the start argument
--wayland-socket-name
are used instead. If the argument is not set, the compositor tries to find a socket name, which is
wayland-0
在默認情況下。
訪問函數:
| QByteArray | socketName () const |
| void | setSocketName (const QByteArray & name ) |
通知程序信號:
| void | socketNameChanged (const QByteArray & socketName ) |
This property holds whether the hardware integration extension should be enabled for this QWaylandCompositor .
This property must be set before the compositor is created .
訪問函數:
| bool | useHardwareIntegrationExtension () const |
| void | setUseHardwareIntegrationExtension (bool 使用 ) |
通知程序信號:
| void | useHardwareIntegrationExtensionChanged () |
Constructs a QWaylandCompositor with the given parent .
[override virtual]
QWaylandCompositor::
~QWaylandCompositor
()
[invokable]
void
QWaylandCompositor::
addSocketDescriptor
(
int
fd
)
Listen for client connections on a file descriptor, fd , referring to a server socket already bound and listening.
Does not take ownership of the file descriptor; it must be closed explicitly if needed.
注意: This method is only available with libwayland 1.10.0 or newer. If built against an earlier libwayland runtime, this method is a noop.
注意: 此函數可以被援引,通過元對象係統和從 QML。見 Q_INVOKABLE .
[虛擬]
void
QWaylandCompositor::
create
()
初始化 QWaylandCompositor . If you override this function in your subclass, be sure to call the base class implementation.
[invokable]
void
QWaylandCompositor::
destroyClient
(
QWaylandClient
*
client
)
銷毀 client .
注意: 此函數可以被援引,通過元對象係統和從 QML。見 Q_INVOKABLE .
[invokable]
void
QWaylandCompositor::
destroyClientForSurface
(
QWaylandSurface
*
surface
)
Destroys the client for the surface .
注意: 此函數可以被援引,通過元對象係統和從 QML。見 Q_INVOKABLE .
[虛擬]
void
QWaylandCompositor::
grabSurface
(
QWaylandSurfaceGrabber
*
grabber
, const
QWaylandBufferRef
&
buffer
)
Grab the surface content from the given buffer . The default implementation requires a OpenGL context to be bound to the current thread to work. If this is not possible, reimplement this function in your compositor subclass to implement custom logic. The default implementation only grabs shared memory and OpenGL buffers, reimplement this in your compositor subclass to handle more buffer types.
注意: You should not call this manually, but rather use QWaylandSurfaceGrabber ( grabber ).
[invokable]
QWaylandOutput
*QWaylandCompositor::
outputFor
(
QWindow
*
window
) const
返迴 QWaylandOutput that is connected to the given window .
注意: 此函數可以被援引,通過元對象係統和從 QML。見 Q_INVOKABLE .
Select the seat for a given input event inputEvent . Currently, Qt only supports a single seat, but you can reimplement QWaylandCompositorPrivate::seatFor for a custom seat selection.
[signal]
void
QWaylandCompositor::
surfaceCreated
(
QWaylandSurface
*
surface
)
This signal is emitted when a new QWaylandSurface 實例 surface has been created.
[signal]
void
QWaylandCompositor::
surfaceRequested
(
QWaylandClient
*
client
,
uint
id
,
int
version
)
This signal is emitted when a client has created a surface with id id . The interface version is also available.
The slot connecting to this signal may create and initialize a QWaylandSurface instance in the scope of the slot. Otherwise a default surface is created.
Connections to this signal must be of Qt::DirectConnection connection type.