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

QPdfPageRenderer Class

The QPdfPageRenderer class encapsulates the rendering of pages of a PDF document.

This class was introduced in Qt 5.11.

Article lu   fois.

L'auteur

Liens sociaux

Viadeo Twitter Facebook Share on Google+   

QPdfPageRenderer Class

  • Header: QPdfPageRenderer

  • Since: Qt 5.11

  • Inherits: QObject

Detailed Description

The QPdfPageRenderer contains a queue that collects all render requests that are invoked through requestPage(). Depending on the configured RenderMode the QPdfPageRenderer processes this queue in the main UI thread on next event loop invocation (RenderMode::SingleThreaded) or in a separate worker thread (RenderMode::MultiThreaded) and emits the result through the pageRendered() signal for each request once the rendering is done.

See Also

See also QPdfDocument

Member Type Documentation

 

enum QPdfPageRenderer::RenderMode

This enum describes how the pages are rendered.

Constant

Value

Description

QPdfPageRenderer::RenderMode::MultiThreaded

0

All pages are rendered in a separate worker thread.

QPdfPageRenderer::RenderMode::SingleThreaded

1

All pages are rendered in the main UI thread (default).

See Also

See also renderMode(), setRenderMode()

Property Documentation

 

document : QPdfDocument*

This property holds the document instance this object renders the pages from.

By default, this property is nullptr.

Access functions:

Notifier signal:

  • void documentChanged( *document)

See Also

renderMode : RenderMode

This property holds the mode the renderer uses to render the pages.

By default, this property is RenderMode::SingleThreaded.

Access functions:

Notifier signal:

  • void renderModeChanged( renderMode)

See Also

Member Function Documentation

 

[explicit] QPdfPageRenderer::QPdfPageRenderer(QObject *parent)

Constructs a page renderer object with parent object parent.

[override virtual] QPdfPageRenderer::~QPdfPageRenderer()

Destroys the page renderer object.

QPdfDocument *QPdfPageRenderer::document() const

Returns the document this objects renders the pages from, or a nullptr if none has been set before.

Getter function for property document.

See Also

QPdfPageRenderer::RenderMode QPdfPageRenderer::renderMode() const

Returns the mode of how the pages are rendered.

Getter function for property renderMode.

See Also

quint64 QPdfPageRenderer::requestPage(int pageNumber, QSize imageSize, QPdfDocumentRenderOptions options = QPdfDocumentRenderOptions())

Requests the renderer to render the page pageNumber into a QImage of size imageSize according to the provided options.

Once the rendering is done the pageRendered() signal is emitted with the result as parameters.

The return value is an ID that uniquely identifies the render request. If a request with the same parameters is still in the queue, the ID of that queued request is returned.

void QPdfPageRenderer::setDocument(QPdfDocument *document)

Sets the document this object renders the pages from.

Setter function for property document.

See Also

See also document(), QPdfDocument

void QPdfPageRenderer::setRenderMode(QPdfPageRenderer::RenderMode mode)

Sets the mode of how the pages are rendered to mode.

Setter function for property renderMode.

See Also

See also renderMode(), RenderMode

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