QWaylandCompositor Class

QWaylandCompositor 클래스는 Wayland 디스플레이 서버를 관리합니다. 더 보기...

Header: #include <QWaylandCompositor>
CMake: find_package(Qt6 REQUIRED COMPONENTS WaylandCompositor)
target_link_libraries(mytarget PRIVATE Qt6::WaylandCompositor)
qmake: QT += waylandcompositor
QML에서: 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 use)
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()

상세 설명

QWaylandCompositor는 클라이언트와 다른 outputsseats 에 대한 연결을 관리합니다.

일반적으로 컴포저 애플리케이션은 하나의 WaylandCompositor 인스턴스를 가지며, 이 인스턴스는 여러 출력을 자식으로 가질 수 있습니다.

속성 문서

[since 6.0] additionalShmFormats : QVector<ShmFormat>

이 속성에는 컴포저에서 지원하는 것으로 광고된 추가 wl_shm 형식 목록이 저장됩니다.

기본적으로 필수 ShmFormat_ARGB8888 및 ShmFormat_XRGB8888만 나열되며 이 목록은 비어 있습니다.

이 속성은 컴포저가 created 로 설정되기 전에 설정해야 합니다. 그 이후의 변경 사항은 적용되지 않습니다.

이 프로퍼티는 Qt 6.0에 도입되었습니다.

함수 액세스:

QVector<QWaylandCompositor::ShmFormat> additionalShmFormats() const
void setAdditionalShmFormats(const QVector<QWaylandCompositor::ShmFormat> &additionalShmFormats)

알림 신호:

void additionalShmFormatsChanged()

[read-only] created : const bool

QWaylandCompositor 이 초기화되면 이 속성은 참이고, 그렇지 않으면 거짓입니다.

함수 액세스:

bool isCreated() const

알림 신호:

void createdChanged()

defaultOutput : QWaylandOutput*

이 속성은 QWaylandCompositor 에 추가된 출력 목록에서 첫 번째 출력을 포함하거나 추가된 출력이 없는 경우 null을 포함합니다.

새 기본 출력을 설정하면 출력 목록에 추가되어 새 기본값이 되지만 이전 기본값은 목록에서 제거되지 않습니다. 새 기본 출력이 이미 출력 목록에 있는 경우에는 목록의 맨 앞으로 이동합니다.

기능에 액세스합니다:

QWaylandOutput *defaultOutput() const
void setDefaultOutput(QWaylandOutput *output)

알림 신호:

void defaultOutputChanged()

[read-only] defaultSeat : QWaylandSeat* const

이 속성에는 이 QWaylandCompositor 에 대한 기본 시트가 포함되어 있습니다.

액세스 함수:

QWaylandSeat *defaultSeat() const

알림 신호:

void defaultSeatChanged(QWaylandSeat *newDevice, QWaylandSeat *oldDevice)

retainedSelection : bool

이 속성은 유지된 선택이 활성화되어 있는지 여부를 저장합니다.

액세스 함수:

bool retainedSelectionEnabled() const
void setRetainedSelectionEnabled(bool enabled)

알림 신호:

void retainedSelectionChanged(bool retainedSelection)

socketName : QByteArray

이 속성은 QWaylandCompositor 에서 클라이언트와 통신하는 데 사용하는 소켓 이름을 보유합니다. QWaylandCompositorcreated 이 되기 전에 설정해야 합니다.

socketName이 비어 있으면(기본값), 시작 인수 --wayland-socket-name 의 내용이 대신 사용됩니다. 인수가 설정되지 않은 경우 컴포저는 기본적으로 wayland-0 인 소켓 이름을 찾으려고 시도합니다.

함수 액세스:

QByteArray socketName() const
void setSocketName(const QByteArray &name)

알림 신호:

void socketNameChanged(const QByteArray &socketName)

useHardwareIntegrationExtension : bool

이 프로퍼티는 하드웨어 통합 확장을 이 QWaylandCompositor 에 대해 활성화할지 여부를 보유합니다.

이 프로퍼티는 컴포저가 created.

함수에 액세스합니다:

bool useHardwareIntegrationExtension() const
void setUseHardwareIntegrationExtension(bool use)

노티파이 신호:

void useHardwareIntegrationExtensionChanged()

멤버 함수 문서

QWaylandCompositor::QWaylandCompositor(QObject *parent = nullptr)

주어진 parent 로 QWaylandCompositor 를 생성합니다.

[override virtual noexcept] QWaylandCompositor::~QWaylandCompositor()

를 파괴합니다. QWaylandCompositor

[invokable] void QWaylandCompositor::addSocketDescriptor(int fd)

이미 바인딩되어 수신 대기 중인 서버 소켓을 참조하는 파일 설명자 fd 에서 클라이언트 연결을 수신 대기합니다.

파일 기술자에 대한 소유권을 가지지 않으므로 필요한 경우 명시적으로 닫아야 합니다.

참고: 이 메서드는 libwayland 1.10.0 이상에서만 사용할 수 있습니다. 이전 libwayland 런타임에 대해 빌드된 경우 이 메서드는 noop입니다.

참고: 이 함수는 메타 객체 시스템과 QML을 통해 호출할 수 있습니다. Q_INVOKABLE 을 참조하세요.

[virtual] void QWaylandCompositor::create()

QWaylandCompositor 을 초기화합니다. 하위 클래스에서 이 함수를 재정의하는 경우 반드시 기본 클래스 구현을 호출해야 합니다.

[invokable] void QWaylandCompositor::destroyClient(QWaylandClient *client)

client 을 파괴합니다.

참고: 이 함수는 메타 객체 시스템과 QML을 통해 호출할 수 있습니다. Q_INVOKABLE 을 참조하세요.

[invokable] void QWaylandCompositor::destroyClientForSurface(QWaylandSurface *surface)

surface 에 대한 클라이언트를 삭제합니다.

참고: 이 함수는 메타객체 시스템과 QML을 통해 호출할 수 있습니다. Q_INVOKABLE 을 참조하세요.

[virtual] void QWaylandCompositor::grabSurface(QWaylandSurfaceGrabber *grabber, const QWaylandBufferRef &buffer)

주어진 buffer 에서 표면 콘텐츠를 가져옵니다. 기본 구현은 현재 스레드에 바인딩된 OpenGL 컨텍스트가 있어야 작동합니다. 이것이 가능하지 않은 경우 컴포저 서브클래스에서 이 함수를 다시 구현하여 사용자 정의 로직을 구현하세요. 기본 구현은 공유 메모리와 OpenGL 버퍼만 가져오므로 더 많은 버퍼 유형을 처리하려면 컴포저 서브클래스에서 이 함수를 다시 구현하세요.

참고: 이 함수를 수동으로 호출하지 말고 QWaylandSurfaceGrabber (grabber)를 사용하세요.

[invokable] QWaylandOutput *QWaylandCompositor::outputFor(QWindow *window) const

주어진 window 에 연결된 QWaylandOutput 을 반환합니다.

참고: 이 함수는 메타 객체 시스템과 QML을 통해 호출할 수 있습니다. Q_INVOKABLE 을 참조하세요.

QWaylandSeat *QWaylandCompositor::seatFor(QInputEvent *inputEvent)

주어진 입력 이벤트에 대한 좌석을 선택합니다 inputEvent. 현재 Qt는 단일 시트만 지원합니다.

[signal] void QWaylandCompositor::surfaceCreated(QWaylandSurface *surface)

이 신호는 새 QWaylandSurface 인스턴스 surface 가 생성될 때 발생합니다.

[signal] void QWaylandCompositor::surfaceRequested(QWaylandClient *client, uint id, int version)

이 신호는 client 가 아이디가 id 인 서페이스를 만들었을 때 방출됩니다. version 인터페이스도 사용할 수 있습니다.

이 신호에 연결되는 슬롯은 해당 슬롯의 범위에서 QWaylandSurface 인스턴스를 생성하고 초기화할 수 있습니다. 그렇지 않으면 기본 서페이스가 만들어집니다.

이 신호에 대한 연결은 Qt::DirectConnection 연결 유형이어야 합니다.

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