QgsMapRendererParallelJob class

Job implementation that renders all layers in parallel.

Contents

The resulting map image can be retrieved with renderedImage() function. It is safe to call that function while rendering is active to see preview of the map.

Base classes

class QgsMapRendererQImageJob
Intermediate base class adding functionality that allows client to query the rendered image.

Public functions

void cancel() override
Stop the rendering job - does not return until the job has terminated.
void cancelWithoutBlocking() override
Triggers cancelation of the rendering job without blocking.
auto isActive() const -> bool override
Tell whether the rendering job is currently running in background.
auto renderedImage() -> QImage override
Gets a preview/resulting image.
void start() override
Start the rendering job and immediately return.
auto takeLabelingResults() -> QgsLabelingResults* override
Gets pointer to internal labeling engine (in order to get access to the results).
auto usedCachedLabels() const -> bool override
Returns true if the render job was able to use a cached labeling solution.
void waitForFinished() override
Block until the job has finished.

Function documentation

void QgsMapRendererParallelJob::cancel() override

Stop the rendering job - does not return until the job has terminated.

Does nothing if the rendering is not active.

void QgsMapRendererParallelJob::cancelWithoutBlocking() override

Triggers cancelation of the rendering job without blocking.

The render job will continue to operate until it is able to cancel, at which stage the finished() signal will be emitted. Does nothing if the rendering is not active.

void QgsMapRendererParallelJob::start() override

Start the rendering job and immediately return.

Does nothing if the rendering is already in progress.

QgsLabelingResults* QgsMapRendererParallelJob::takeLabelingResults() override

Gets pointer to internal labeling engine (in order to get access to the results).

This should not be used if cached labeling was redrawn - see usedCachedLabels().

bool QgsMapRendererParallelJob::usedCachedLabels() const override

Returns true if the render job was able to use a cached labeling solution.

If so, any previously stored labeling results (see takeLabelingResults()) should be retained.