QWaylandSurfaceRole Class

QWaylandSurfaceRole 클래스는 wl_surface의 컨텍스트에서 서페이스의 역할을 나타냅니다. 더 보기...

Header: #include <QWaylandSurfaceRole>
CMake: find_package(Qt6 REQUIRED COMPONENTS WaylandCompositor)
target_link_libraries(mytarget PRIVATE Qt6::WaylandCompositor)
qmake: QT += waylandcompositor

공용 함수

QWaylandSurfaceRole(const QByteArray &name)
const QByteArray name()

상세 설명

QWaylandSurfaceRole은 QWaylandSurface 의 역할을 나타내는 데 사용됩니다. 프로토콜 사양에 따르면 서페이스의 역할은 한번 설정하면 영구적이며, 나중에 동일한 서페이스가 다른 역할에 재사용되면 프로토콜 오류에 해당합니다. 서페이스를 동일한 역할로 여러 번 설정하는 것은 오류가 아닙니다.

예를 들어 QWaylandXdgShell 은 서페이스에 "팝업" 또는 "토플 레벨" 역할을 할당할 수 있습니다. 이전에 get_popup 요청을 받은 서페이스에서 get_toplevel 을 요청하면 컴포저는 프로토콜 오류를 발생시킵니다.

역할은 포인터 값으로 비교되므로 QWaylandSurfaceRole의 두 개체는 names 에 관계없이 서로 다른 역할로 간주됩니다. 역할을 할당하는 일반적인 방법은 이를 나타내는 정적 QWaylandSurfaceRole 객체를 갖는 것입니다.

class MyShellSurfaceSubType
{
    static QWaylandSurfaceRole s_role;
    // ...
};

// ...

surface->setRole(&MyShellSurfaceSubType::s_role, resource->handle, MY_ERROR_CODE);

멤버 함수 문서

QWaylandSurfaceRole::QWaylandSurfaceRole(const QByteArray &name)

QWaylandSurfaceRole을 생성하고 name 에 할당합니다. 이 이름은 이 QWaylandSurfaceRole과 관련된 오류 메시지에 사용됩니다.

const QByteArray QWaylandSurfaceRole::name()

QWaylandSurfaceRole 의 이름을 반환합니다. 이 이름은 예를 들어 서페이스의 역할을 변경하려고 시도하는 경우와 같이 QWaylandSurfaceRole 과 관련된 오류 메시지에 사용됩니다.

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