18 #ifndef QGSMAPRENDERERTASK_H 19 #define QGSMAPRENDERERTASK_H 22 #include "qgis_core.h" 49 ImageAllocationFail = 1,
51 ImageUnsupportedFormat
58 const QString &fileName,
59 const QString &fileFormat = QString(
"PNG" ),
60 bool forceRaster =
false );
71 void addAnnotations( QList< QgsAnnotation * > annotations );
76 void addDecorations(
const QList<QgsMapDecoration *> &decorations );
90 void renderingComplete();
95 void errorOccurred(
int error );
100 void finished(
bool result )
override;
107 std::unique_ptr< QgsMapRendererCustomPainterJob > mJob;
109 QPainter *mPainter =
nullptr;
113 bool mForceRaster =
false;
114 bool mSaveWorldFile =
false;
116 QList< QgsAnnotation * > mAnnotations;
117 QList< QgsMapDecoration * > mDecorations;
Job implementation that renders everything sequentially using a custom painter.
void setSaveWorldFile(bool save)
Sets whether a world file will be created alongside an image file.
QgsTask task which draws a map to an image file or a painter as a background task.
The QgsMapSettings class contains configuration for rendering of the map.
Abstract base class for long running background tasks.
virtual void cancel()
Notifies the task that it should terminate.
virtual void finished(bool result)
If the task is managed by a QgsTaskManager, this will be called after the task has finished (whether ...
virtual bool run()=0
Performs the task's operation.