32 mImage.fill( Qt::transparent );
41 QgsDebugMsgLevel( QStringLiteral(
"SEQUENTIAL destruct -- still running! (canceling)" ), 5 );
45 Q_ASSERT( !mInternalJob && !mPainter );
54 mLabelingResults.reset();
62 Q_ASSERT( !mInternalJob && !mPainter );
64 mPainter =
new QPainter( &mImage );
71 mInternalJob->
start();
83 Q_ASSERT( !mInternalJob && !mPainter );
105 return nullptr != mInternalJob;
110 return mUsedCachedLabels;
115 return mLabelingResults.release();
144 mInternalJob->deleteLater();
145 mInternalJob =
nullptr;
Class that stores computed placement from labeling engine.
Job implementation that renders everything sequentially using a custom painter.
void cancel() override
Stop the rendering job - does not return until the job has terminated.
const LayerRenderJobs & jobs() const
QgsLabelingResults * takeLabelingResults() override
Gets pointer to internal labeling engine (in order to get access to the results).
void cancelWithoutBlocking() override
Triggers cancellation of the rendering job without blocking.
void waitForFinished() override
Block until the job has finished.
void start() override
Start the rendering job and immediately return.
bool usedCachedLabels() const override
Returns true if the render job was able to use a cached labeling solution.
void setCache(QgsMapRendererCache *cache)
Assign a cache to be used for reading and storing rendered images of individual layers.
Errors errors() const
List of errors that happened during the rendering job - available when the rendering has been finishe...
QElapsedTimer mRenderingStart
QgsMapRendererCache * mCache
void finished()
emitted when asynchronous rendering is finished (or canceled).
static QImage composeImage(const QgsMapSettings &settings, const LayerRenderJobs &jobs, const LabelRenderJob &labelJob, const QgsMapRendererCache *cache=nullptr)
Intermediate base class adding functionality that allows client to query the rendered image.
bool usedCachedLabels() const override
Returns true if the render job was able to use a cached labeling solution.
void cancelWithoutBlocking() override
Triggers cancellation of the rendering job without blocking.
~QgsMapRendererSequentialJob() override
QImage renderedImage() override
Gets a preview/resulting image.
void waitForFinished() override
Block until the job has finished.
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).
QgsMapRendererSequentialJob(const QgsMapSettings &settings)
void start() override
Start the rendering job and immediately return.
bool isActive() const override
Tell whether the rendering job is currently running in background.
The QgsMapSettings class contains configuration for rendering of the map.
QSize deviceOutputSize() const
Returns the device output size of the map render.
float devicePixelRatio() const
Returns the device pixel ratio.
QImage::Format outputImageFormat() const
format of internal QImage, default QImage::Format_ARGB32_Premultiplied
double outputDpi() const
Returns the DPI (dots per inch) used for conversion between real world units (e.g.
#define QgsDebugMsgLevel(str, level)