QGIS API Documentation
3.26.3-Buenos Aires (65e4edfdad)
|
Go to the documentation of this file.
32 mImage.setDotsPerMeterX( 1000 * settings.
outputDpi() / 25.4 );
33 mImage.setDotsPerMeterY( 1000 * settings.
outputDpi() / 25.4 );
34 mImage.fill( Qt::transparent );
43 QgsDebugMsgLevel( QStringLiteral(
"SEQUENTIAL destruct -- still running! (canceling)" ), 5 );
47 Q_ASSERT( !mInternalJob && !mPainter );
51 void QgsMapRendererSequentialJob::startPrivate()
56 mLabelingResults.reset();
64 Q_ASSERT( !mInternalJob && !mPainter );
66 mPainter =
new QPainter( &mImage );
76 mInternalJob->
start();
88 Q_ASSERT( !mInternalJob && !mPainter );
110 return nullptr != mInternalJob;
115 return mUsedCachedLabels;
120 return mLabelingResults.release();
152 mInternalJob->deleteLater();
153 mInternalJob =
nullptr;
QStringList mLayersRedrawnFromCache
void cancel() override
Stop the rendering job - does not return until the job has terminated.
void layerRenderingStarted(const QString &layerId)
Emitted just before rendering starts for a particular layer.
QgsMapRendererCache * mCache
static QImage composeImage(const QgsMapSettings &settings, const std::vector< LayerRenderJob > &jobs, const LabelRenderJob &labelJob, const QgsMapRendererCache *cache=nullptr)
void waitForFinished() override
Block until the job has finished.
const std::vector< LayerRenderJob > & jobs() const
void cancelWithoutBlocking() override
Triggers cancellation of the rendering job without blocking.
#define QgsDebugMsgLevel(str, level)
~QgsMapRendererSequentialJob() override
float devicePixelRatio() const
Returns the device pixel ratio.
Class that stores computed placement from labeling engine.
std::unique_ptr< QgsRenderedItemResults > mRenderedItemResults
QElapsedTimer mRenderingStart
QImage::Format outputImageFormat() const
format of internal QImage, default QImage::Format_ARGB32_Premultiplied
void cancel() override
Stop the rendering job - does not return until the job has terminated.
void layerRendered(const QString &layerId)
Emitted when a layer has completed rendering.
QgsLabelingResults * takeLabelingResults() override
Gets pointer to internal labeling engine (in order to get access to the results).
Errors errors() const
List of errors that happened during the rendering job - available when the rendering has been finishe...
void cancelWithoutBlocking() override
Triggers cancellation of the rendering job without blocking.
void start()
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.
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.
QgsLabelSink * labelSink() const
Returns the label sink associated to this rendering job.
QgsRenderedItemResults * takeRenderedItemResults()
Takes the rendered item results from the map render job and returns them.
bool usedCachedLabels() const override
Returns true if the render job was able to use a cached labeling solution.
Job implementation that renders everything sequentially using a custom painter.
QSize deviceOutputSize() const
Returns the device output size of the map render.
Intermediate base class adding functionality that allows client to query the rendered image.
QgsMapRendererSequentialJob(const QgsMapSettings &settings)
void waitForFinished() override
Block until the job has finished.
QStringList layersRedrawnFromCache() const
Returns a list of the layer IDs for all layers which were redrawn from cached images.
bool isActive() const override
Tell whether the rendering job is currently running in background.
double outputDpi() const
Returns the DPI (dots per inch) used for conversion between real world units (e.g.
The QgsMapSettings class contains configuration for rendering of the map. The rendering itself is don...
QImage renderedImage() override
Gets a preview/resulting image.
void finished()
emitted when asynchronous rendering is finished (or canceled).
void setLabelSink(QgsLabelSink *sink)
Assigns the label sink which will take over responsibility for handling labels during the rendering j...