이 페이지에서

QWaylandCompositor Class

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

헤더: #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는 클라이언트와의 연결은 물론, 다양한 outputs 및 seats 을 관리합니다.

일반적으로 컴포지터 애플리케이션에는 하나의 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 : bool

QWaylandCompositor 가 초기화된 경우 이 속성은 true이며, 그렇지 않은 경우 false입니다.

액세스 함수:

bool isCreated() const

Notifier 신호:

void createdChanged()

defaultOutput : QWaylandOutput*

이 속성은 QWaylandCompositor 에 추가된 출력 목록의 첫 번째 항목을 포함하며, 출력이 추가되지 않은 경우에는 null을 반환합니다.

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

액세스 함수:

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

알림 신호:

void defaultOutputChanged()

[read-only] defaultSeat : QWaylandSeat*

이 속성에는 이 QWaylandCompositor 의 기본 좌석이 포함되어 있습니다.

액세스 기능:

QWaylandSeat *defaultSeat() const

알림 신호:

void defaultSeatChanged(QWaylandSeat *newDevice, QWaylandSeat *oldDevice)

retainedSelection : bool

이 속성은 컴포지터가 클립보드 선택 데이터의 사본을 유지할지 여부를 제어합니다. ` true`로 설정된 경우, 컴포지터는 소유 클라이언트로부터 모든 클립보드 데이터를 즉시 읽어와 캐시에 저장합니다. 이로 인해 성능상의 비용이 발생합니다. 기본값은 ` false`입니다.

액세스 함수:

bool retainedSelectionEnabled() const
void setRetainedSelectionEnabled(bool enabled)

알림 신호:

void retainedSelectionChanged(bool retainedSelection)

QWaylandCompositor ::retainedSelectionReceived() 및 QWaylandSurface::updateSelection()도 참조하십시오 .

socketName : QByteArray

이 속성은 QWaylandCompositor 가 클라이언트와 통신할 때 사용하는 소켓 이름을 저장합니다. 이 값은 QWaylandCompositor 가 created 로 설정되기 전에 반드시 설정되어야 합니다.

socketName이 비어 있는 경우(기본값), 대신 --wayland-socket-name 의 start 인자 내용이 사용됩니다. 인자가 설정되지 않은 경우, 컴포지터는 소켓 이름을 찾으려 시도하며, 기본값은 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 런타임을 대상으로 빌드된 경우, 이 메서드는 아무 작업도 수행하지 않습니다.

참고: 이 함수는 메타 객체 시스템과 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가 id 인 서페이스를 생성했을 때 발송됩니다. version 인터페이스도 사용할 수 있습니다.

이 신호에 연결된 슬롯은 슬롯의 범위 내에서 QWaylandSurface 인스턴스를 생성하고 초기화할 수 있습니다. 그렇지 않으면 기본 서페이스가 생성됩니다.

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

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