33 mImage.fill( Qt::transparent );
42 QgsDebugMsgLevel( QStringLiteral(
"SEQUENTIAL destruct -- still running! (canceling)" ), 5 );
46 Q_ASSERT( !mInternalJob && !mPainter );
50 void QgsMapRendererSequentialJob::startPrivate()
55 mLabelingResults.reset();
63 Q_ASSERT( !mInternalJob && !mPainter );
65 mPainter =
new QPainter( &mImage );
72 mInternalJob->
start();
84 Q_ASSERT( !mInternalJob && !mPainter );
106 return nullptr != mInternalJob;
111 return mUsedCachedLabels;
116 return mLabelingResults.release();
145 mInternalJob->deleteLater();
146 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.
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)
void start()
Start the rendering job and immediately return.
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)
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)