QWaylandSurfaceRole Class
QWaylandSurfaceRole 클래스는 wl_surface의 맥락에서 표면의 역할을 나타냅니다. 더 보기...
| 헤더: | #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 `는 표면에 “popup” 또는 “toplevel” 역할을 할당할 수 있습니다. 이전에 ` get_popup ` 요청을 받은 표면에 대해 ` get_toplevel `가 요청되면, 컴포지터는 프로토콜 오류를 발생시킵니다.
역할은 포인터 값으로 비교되므로, names 가 무엇이든 상관없이 두 개의 QWaylandSurfaceRole 객체는 서로 다른 역할로 간주됩니다. 역할을 할당하는 일반적인 방법은 이를 나타내는 정적 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 와 관련된 오류 메시지에 사용되며, 예를 들어 서페이스의 역할을 변경하려고 시도할 때와 같은 경우에 해당합니다.
© 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.