29 mImage.setDotsPerMeterX( 1000 * settings.
outputDpi() / 25.4 );
30 mImage.setDotsPerMeterY( 1000 * settings.
outputDpi() / 25.4 );
31 mImage.fill( Qt::transparent );
44 Q_ASSERT( !mInternalJob && !mPainter );
53 mLabelingResults.reset();
61 Q_ASSERT( !mInternalJob && !mPainter );
63 mPainter =
new QPainter( &mImage );
70 mInternalJob->
start();
82 Q_ASSERT( !mInternalJob && !mPainter );
104 return nullptr != mInternalJob;
109 return mUsedCachedLabels;
114 return mLabelingResults.release();
143 mInternalJob->deleteLater();
144 mInternalJob =
nullptr;
void finished()
emitted when asynchronous rendering is finished (or canceled).
const LayerRenderJobs & jobs() const
Job implementation that renders everything sequentially using a custom painter.
void start() override
Start the rendering job and immediately return.
Errors errors() const
List of errors that happened during the rendering job - available when the rendering has been finishe...
void cancel() override
Stop the rendering job - does not return until the job has terminated.
void cancel() override
Stop the rendering job - does not return until the job has terminated.
QgsLabelingResults * takeLabelingResults() override
Gets pointer to internal labeling engine (in order to get access to the results). ...
void setCache(QgsMapRendererCache *cache)
Assign a cache to be used for reading and storing rendered images of individual layers.
The QgsMapSettings class contains configuration for rendering of the map.
static QImage composeImage(const QgsMapSettings &settings, const LayerRenderJobs &jobs, const LabelRenderJob &labelJob)
void start() override
Start the rendering job and immediately return.
#define QgsDebugMsgLevel(str, level)
QgsMapRendererSequentialJob(const QgsMapSettings &settings)
QImage::Format outputImageFormat() const
format of internal QImage, default QImage::Format_ARGB32_Premultiplied
bool usedCachedLabels() const override
Returns true if the render job was able to use a cached labeling solution.
void cancelWithoutBlocking() override
Triggers cancelation of the rendering job without blocking.
double outputDpi() const
Returns DPI used for conversion between real world units (e.g.
QImage renderedImage() override
Gets a preview/resulting image.
Intermediate base class adding functionality that allows client to query the rendered image...
void cancelWithoutBlocking() override
Triggers cancelation of the rendering job without blocking.
Class that stores computed placement from labeling engine.
bool isActive() const override
Tell whether the rendering job is currently running in background.
void waitForFinished() override
Block until the job has finished.
QgsLabelingResults * takeLabelingResults() override
Gets pointer to internal labeling engine (in order to get access to the results). ...
bool usedCachedLabels() const override
Returns true if the render job was able to use a cached labeling solution.
void waitForFinished() override
Block until the job has finished.
QgsMapRendererCache * mCache
QSize outputSize() const
Returns the size of the resulting map image.
~QgsMapRendererSequentialJob() override