IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)

QWaylandSurfaceGrabber Class

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

This class was introduced in Qt 5.8.

Article lu   fois.

L'auteur

Liens sociaux

Viadeo Twitter Facebook Share on Google+   

QWaylandSurfaceGrabber Class

  • Header: QWaylandSurfaceGrabber

  • Since: Qt 5.8

  • qmake: QT += waylandcompositor

  • Inherits: QObject

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.

Constant

Value

Description

QWaylandSurfaceGrabber::InvalidSurface

0

The surface is null or otherwise not valid.

QWaylandSurfaceGrabber::NoBufferAttached

1

The client has not attached a buffer on the surface yet.

QWaylandSurfaceGrabber::UnknownBufferType

2

The buffer attached on the surface is of an unknown type.

QWaylandSurfaceGrabber::RendererNotReady

3

The compositor renderer is not ready to grab the surface content.

Member Function Documentation

 

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

Create a QWaylandSurfaceGrabber object with the given surface and parent

void QWaylandSurfaceGrabber::grab()

Grab the content of the surface set on this object. It may not be possible to do that immediately so the success and failed signals should be used to be notified of when the grab is completed.

QWaylandSurface *QWaylandSurfaceGrabber::surface() const

Returns the surface set on this object

Vous avez aimé ce tutoriel ? Alors partagez-le en cliquant sur les boutons suivants : Viadeo Twitter Facebook Share on Google+