이 페이지에서

QWaylandSurfaceGrabber Class

QWaylandSurfaceGrabber 클래스를 사용하면 QWaylandSurface 의 내용을 읽을 수 있습니다. 더 보기...

헤더: #include <QWaylandSurfaceGrabber>
CMake: find_package(Qt6 REQUIRED COMPONENTS WaylandCompositor)
target_link_libraries(mytarget PRIVATE Qt6::WaylandCompositor)
qmake: QT += waylandcompositor
상속: QObject

공개 유형

enum Error { InvalidSurface, NoBufferAttached, UnknownBufferType, RendererNotReady }

공개 함수

QWaylandSurfaceGrabber(QWaylandSurface *surface, QObject *parent = nullptr)
void grab()
QWaylandSurface *surface() const

상세 설명

사용자에게 스크린샷을 제공하는 등, 서페이스의 내용을 가져와야 할 때가 있습니다. QWaylandSurfaceGrabber 클래스는 공유 메모리, OpenGL 또는 그 밖의 다른 것이든 상관없이, 서페이스를 뒷받침하는 버퍼의 유형을 신경 쓸 필요 없이 이를 수행할 수 있는 간단한 방법을 제공합니다.

멤버 유형 설명

enum QWaylandSurfaceGrabber::Error

Error 열거형은 그랩 실패의 원인을 설명합니다.

상수값설명
QWaylandSurfaceGrabber::InvalidSurface0서페이스가 null이거나 다른 이유로 유효하지 않습니다.
QWaylandSurfaceGrabber::NoBufferAttached1클라이언트가 아직 서페이스에 버퍼를 연결하지 않았습니다.
QWaylandSurfaceGrabber::UnknownBufferType2표면에 연결된 버퍼의 유형이 알 수 없습니다.
QWaylandSurfaceGrabber::RendererNotReady3컴포지터 렌더러가 서피스 콘텐츠를 가져올 준비가 되어 있지 않습니다.

멤버 함수 문서

[explicit] QWaylandSurfaceGrabber::QWaylandSurfaceGrabber(QWaylandSurface *surface, QObject *parent = nullptr)

주어진 ` surface `를 사용하여 `QWaylandSurfaceGrabber` 객체를 생성하고, parent

void QWaylandSurfaceGrabber::grab()

이 객체에 설정된 표면의 내용을 가져옵니다. 이 작업이 즉시 수행되지 않을 수도 있으므로, 가져오기가 완료되었음을 알기 위해서는 성공 및 실패 신호를 사용해야 합니다.

QWaylandSurface *QWaylandSurfaceGrabber::surface() const

이 객체에 설정된 표면 집합을 반환합니다.

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