이 페이지에서

QWaylandSurface Class

QWaylandSurface 클래스는 출력 장치상의 직사각형 영역을 나타냅니다. 더 보기...

헤더: #include <QWaylandSurface>
CMake: find_package(Qt6 REQUIRED COMPONENTS WaylandCompositor)
target_link_libraries(mytarget PRIVATE Qt6::WaylandCompositor)
qmake: QT += waylandcompositor
QML에서: WaylandSurface
상속: QWaylandObject

공개 타입

enum Origin { OriginTopLeft, OriginBottomLeft }

속성

공개 함수

QWaylandSurface()
QWaylandSurface(QWaylandCompositor *compositor, QWaylandClient *client, uint id, int version)
virtual ~QWaylandSurface() override
int bufferScale() const
QSize bufferSize() const
QWaylandClient *client() const
QWaylandCompositor *compositor() const
Qt::ScreenOrientation contentOrientation() const
QSize destinationSize() const
void destroy()
void frameStarted()
bool hasContent() const
bool inhibitsIdle() const
void initialize(QWaylandCompositor *compositor, QWaylandClient *client, uint id, int version)
bool inputRegionContains(const QPoint &p) const
bool inputRegionContains(const QPointF &position) const
bool isCursorSurface() const
bool isDestroyed() const
bool isInitialized() const
bool isOpaque() const
void markAsCursorSurface(bool cursorSurface)
QWaylandSurface::Origin origin() const
QWaylandView *primaryView() const
struct wl_resource *resource() const
void sendFrameCallbacks()
void setPrimaryView(QWaylandView *view)
bool setRole(QWaylandSurfaceRole *role, wl_resource *errorResource, uint32_t errorCode)
QRectF sourceGeometry() const
QList<QWaylandView *> views() const
wl_client *waylandClient() const

공개 슬롯

신호

정적 공용 멤버

QWaylandSurface *fromResource(wl_resource *resource)

상세 설명

이 클래스는 출력 장치에 표시되는 직사각형 픽셀 영역을 캡슐화합니다. 이는 Wayland 프로토콜의 wl_surface 인터페이스에 해당합니다.

멤버 유형 설명

enum QWaylandSurface::Origin

이 열거형 유형은 QWaylandSurface 의 버퍼 원점을 지정하는 데 사용됩니다.

상수상수 값설명
QWaylandSurface::OriginTopLeft0원점은 버퍼의 왼쪽 상단 모서리입니다.
QWaylandSurface::OriginBottomLeft1원점은 버퍼의 왼쪽 하단 모서리입니다.

속성 설명

[read-only] bufferScale : int

이 속성은 QWaylandSurface 의 버퍼 배율을 저장합니다. 버퍼 배율을 사용하면 클라이언트가 고해상도 출력에서 사용할 고해상도 버퍼 데이터를 제공할 수 있습니다.

액세스 함수:

int bufferScale() const

알림 신호:

void bufferScaleChanged()

[read-only] bufferSize : QSize

이 속성은 이 QWaylandSurface 의 현재 버퍼 크기를 표면 좌표가 아닌 픽셀 단위로 저장합니다.

표면 좌표계에서의 크기를 확인하려면 대신 ` destinationSize `를 사용하십시오.

액세스 함수:

QSize bufferSize() const

알림 신호:

void bufferSizeChanged()

destinationSize 및 bufferScale도 참조하십시오 .

[read-only] client : QWaylandClient* const

이 속성은 QWaylandSurface 를 사용하는 클라이언트를 저장합니다.

액세스 함수:

QWaylandClient *client() const

[read-only] contentOrientation : Qt::ScreenOrientation

이 속성은 ‘ QWaylandSurface ’의 콘텐츠 방향을 지정합니다.

액세스 함수:

Qt::ScreenOrientation contentOrientation() const

알림 신호:

void contentOrientationChanged()

QWaylandOutput::transform도 참조하십시오 .

cursorSurface : bool

이 속성은 ‘ QWaylandSurface ’가 커서 표면인지 여부를 나타냅니다.

액세스 함수:

bool isCursorSurface() const
void markAsCursorSurface(bool cursorSurface)

알림 신호:

void cursorSurfaceChanged()

[read-only] destinationSize : QSize

이 속성은 표면 좌표계에서 이 WaylandSurface 의 크기를 나타냅니다.

액세스 함수:

QSize destinationSize() const

알림 신호:

void destinationSizeChanged()

bufferScale 및 bufferSize항목도 참조하십시오 .

[read-only] hasContent : bool

이 속성은 표면에 현재 확정된, null이 아닌 버퍼가 있는지 여부를 나타냅니다.

액세스 함수:

bool hasContent() const

알림 신호:

void hasContentChanged()

QWaylandSurface::bufferSize도 참조하십시오 .

[read-only] inhibitsIdle : bool

이 속성은 해당 표면이 화면 어둡게 하기, 화면 잠금, 화면 보호기 등 컴포지터의 유휴 동작을 억제하도록 설계되었는지 여부를 나타냅니다.

액세스 함수:

bool inhibitsIdle() const

알림 신호:

void inhibitsIdleChanged()

QWaylandIdleInhibitManagerV1도 참조하십시오 .

[read-only, since 6.4] isOpaque : bool

이 속성은 클라이언트가 set_opaque_region 요청을 통해 보고한 대로 표면이 완전히 불투명한지 여부와 관계없이 유지됩니다.

이 열거형은 Qt 6.4에서 도입되었습니다.

액세스 함수:

bool isOpaque() const

Notifier 신호:

void isOpaqueChanged()

[read-only] origin : QWaylandSurface::Origin

이 속성은 QWaylandSurface 의 버퍼 원점을 저장하며, 표면에 버퍼가 없는 경우에는 QWaylandSurface::OriginTopLeft 를 저장합니다.

액세스 함수:

QWaylandSurface::Origin origin() const

알림 신호:

void originChanged()

[read-only] sourceGeometry : QRectF

이 속성은 화면에 그려져야 하는 연결된 QWaylandBuffer의 일부를 나타냅니다. 좌표는 버퍼의 모서리를 기준으로 하며, bufferScale 에 따라 크기가 조정됩니다.

액세스 함수:

QRectF sourceGeometry() const

알림 신호:

void sourceGeometryChanged()

bufferScale, bufferSize 및 destinationSize도 참조하십시오 .

멤버 함수 문서

QWaylandSurface::QWaylandSurface()

초기화되지 않은 QWaylandSurface 객체를 생성합니다.

QWaylandSurface::QWaylandSurface(QWaylandCompositor *compositor, QWaylandClient *client, uint id, int version)

지정된 ` compositor ` 및 ` client`에 대해, 그리고 지정된 ` id ` 및 ` version`을 사용하여 `QWaylandSurface`를 생성하고 초기화합니다.

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

QWaylandSurface 를 삭제합니다.

[signal] void QWaylandSurface::childAdded(QWaylandSurface *child)

이 신호는 wl_subsurface child 가 표면에 추가되었을 때 발생합니다.

QWaylandCompositor *QWaylandSurface::compositor() const

이 QWaylandSurface 에 대한 컴포지터를 반환합니다.

[invokable] void QWaylandSurface::destroy()

QWaylandSurface 를 삭제합니다.

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

[signal] void QWaylandSurface::dragStarted(QWaylandDrag *drag)

이 신호는 이 표면에서 ‘ drag ’가 시작되었을 때 발신됩니다.

[invokable] void QWaylandSurface::frameStarted()

전송을 위해 모든 프레임 콜백을 준비합니다.

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

[static] QWaylandSurface *QWaylandSurface::fromResource(wl_resource *resource)

Wayland 리소스 resource 에 해당하는 QWaylandSurface 를 반환합니다.

[invokable] void QWaylandSurface::initialize(QWaylandCompositor *compositor, QWaylandClient *client, uint id, int version)

지정된 ` compositor ` 및 ` client`, 그리고 ` id ` 및 ` version`을 사용하여 ` QWaylandSurface `을 초기화합니다.

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

bool QWaylandSurface::inputRegionContains(const QPoint &p) const

QWaylandSurface 의 입력 영역에 점 p 이 포함되어 있으면 true 을 반환합니다. 그렇지 않으면 false 을 반환합니다.

bool QWaylandSurface::inputRegionContains(const QPointF &position) const

QWaylandSurface 의 입력 영역에 점 position 이 포함되어 있으면 true 을 반환합니다. 그렇지 않으면 false 을 반환합니다.

[invokable] bool QWaylandSurface::isDestroyed() const

QWaylandSurface 가 소멸된 경우 true를 반환합니다. 그렇지 않으면 false를 반환합니다.

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

bool QWaylandSurface::isInitialized() const

QWaylandSurface 가 초기화된 경우 true를 반환합니다.

QWaylandView *QWaylandSurface::primaryView() const

이 QWaylandSurface 의 기본 뷰를 반환합니다.

QWaylandView::advance() 및 QWaylandSurface::setPrimaryView()도 참조하십시오 .

struct wl_resource *QWaylandSurface::resource() const

이 QWaylandSurface 에 해당하는 Wayland 리소스를 반환합니다.

[invokable] void QWaylandSurface::sendFrameCallbacks()

보류 중인 프레임 콜백을 전송합니다.

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

void QWaylandSurface::setPrimaryView(QWaylandView *view)

이 표면( QWaylandSurface)에 여러 뷰가 있는 경우, 이 표면의 주 뷰(primary view)를 view 로 설정합니다. 주 뷰는 클라이언트의 재생 빈도를 제어하는 뷰입니다. 이 뷰는 QWaylandView::advance()가 호출될 때 버퍼 참조를 제거하는 역할을 합니다. 자세한 내용은 QWaylandView::advance() 문서를 참조하십시오.

QWaylandWlShellIntegration 및 QWaylandXdgShellV5Integration과 같은 셸 서피스 통합의 경우, 클라이언트로부터의 최대화 및 전체 화면 요청은 해당 통합이 서피스의 주 뷰를 가지고 있을 때만 효과가 있습니다.

primaryView() 및 QWaylandView::advance()도 참조하십시오 .

bool QWaylandSurface::setRole(QWaylandSurfaceRole *role, wl_resource *errorResource, uint32_t errorCode)

표면에 ‘ role ’을 설정합니다. 역할(role)은 표면이 화면에 어떻게 매핑될지를 정의하며, 역할이 지정되지 않은 표면은 숨겨진 것으로 간주됩니다. 표면에 역할이 한 번 할당되면, 이는 해당 표면의 영구적인 역할이 됩니다. 이후 다른 역할을 사용하여 ` setRole() `를 호출하면 ` errorResource `에 프로토콜 오류가 발생하고 클라이언트에게 ` errorCode `가 전송됩니다. 이 요구 사항을 강제 적용하는 것이 표면 역할의 주된 목적입니다.

` role `는 포인터 값으로 비교됩니다. 이름이 무엇이든 간에, ` QWaylandSurfaceRole `의 두 객체는 서로 다른 역할로 간주됩니다.

표면 역할은 예를 들어 셸 확장 프로그램에서와 같이 표면이 특정 목적으로 채택될 때 프로토콜 구현에 의해 내부적으로 설정됩니다. 이러한 방식으로 표면을 사용하는 확장 프로그램을 개발하는 경우가 아니라면 이 함수를 호출해서는 안 됩니다.

역할을 할당할 수 있으면 true를 반환하고, 그렇지 않으면 false를 반환합니다.

[signal] void QWaylandSurface::surfaceDestroyed()

이 신호는 해당 wl_surface가 소멸될 때 발생합니다.

[slot] void QWaylandSurface::updateSelection()

컴포지터가 클립보드에 저장해 둔 선택 영역으로 표면을 업데이트합니다. 표면이 키보드 포커스를 받을 때 이 작업은 자동으로 수행되지만, 이 함수는 키보드 포커스를 받지 않은 클라이언트를 업데이트하는 데 유용합니다.

QList<QWaylandView *> QWaylandSurface::views() const

이 QWaylandSurface 에 대한 뷰를 반환합니다.

wl_client *QWaylandSurface::waylandClient() const

이 QWaylandSurface 를 사용하여 wl_client 를 고정합니다.

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