QWaylandSurfaceGrabber Class

The QWaylandSurfaceGrabber class allows to read the content of a QWaylandSurface. More...

Header: #include <QWaylandSurfaceGrabber>
qmake: QT += waylandcompositor
Since: Qt 5.8
Inherits: QObject

This class was introduced in Qt 5.8.

Public Types

enum Error { InvalidSurface, NoBufferAttached, UnknownBufferType, RendererNotReady }

Detailed Description

Sometimes it is needed to get the contents of a surface, for example to provide a screenshot to the user. The QWaylandSurfaceGrabber class provides a simple method to do so, without having to care what type of buffer backs the surface, be it shared memory, OpenGL or something else.

Member Type Documentation

enum QWaylandSurfaceGrabber::Error

The Error enum describes the reason for a grab failure.

ConstantValueDescription
QWaylandSurfaceGrabber::InvalidSurface0The surface is null or otherwise not valid.
QWaylandSurfaceGrabber::NoBufferAttached1The client has not attached a buffer on the surface yet.
QWaylandSurfaceGrabber::UnknownBufferType2The buffer attached on the surface is of an unknown type.
QWaylandSurfaceGrabber::RendererNotReady3The compositor renderer is not ready to grab the surface content.