2017-05-14 09:48:41 +02:00
|
|
|
/************************************************************************
|
|
|
|
* This file has been generated automatically from *
|
|
|
|
* *
|
|
|
|
* src/core/qgsmaprenderercustompainterjob.h *
|
|
|
|
* *
|
|
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
|
|
************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-06-22 21:55:09 +07:00
|
|
|
|
|
|
|
class QgsMapRendererCustomPainterJob : QgsMapRendererJob
|
|
|
|
{
|
2017-05-14 09:48:41 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Job implementation that renders everything sequentially using a custom painter.
|
2017-05-14 09:48:41 +02:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
Also supports synchronous rendering in main thread for cases when rendering in background
|
|
|
|
is not an option because of some technical limitations (e.g. printing to printer on some
|
|
|
|
platforms).
|
2017-05-14 09:48:41 +02:00
|
|
|
|
|
|
|
.. versionadded:: 2.4
|
2014-06-22 21:55:09 +07:00
|
|
|
%End
|
|
|
|
|
2017-05-14 09:48:41 +02:00
|
|
|
%TypeHeaderCode
|
|
|
|
#include "qgsmaprenderercustompainterjob.h"
|
|
|
|
%End
|
2014-06-22 21:55:09 +07:00
|
|
|
public:
|
2017-05-01 16:42:33 +02:00
|
|
|
QgsMapRendererCustomPainterJob( const QgsMapSettings &settings, QPainter *painter );
|
2014-06-22 21:55:09 +07:00
|
|
|
~QgsMapRendererCustomPainterJob();
|
|
|
|
|
|
|
|
virtual void start();
|
2017-12-15 08:57:22 +10:00
|
|
|
|
2014-06-22 21:55:09 +07:00
|
|
|
virtual void cancel();
|
2017-12-15 08:57:22 +10:00
|
|
|
|
2017-03-02 12:00:09 +10:00
|
|
|
virtual void cancelWithoutBlocking();
|
2017-12-15 08:57:22 +10:00
|
|
|
|
2014-06-22 21:55:09 +07:00
|
|
|
virtual void waitForFinished();
|
2017-12-15 08:57:22 +10:00
|
|
|
|
2014-06-22 21:55:09 +07:00
|
|
|
virtual bool isActive() const;
|
2017-12-15 08:57:22 +10:00
|
|
|
|
2017-02-07 11:24:30 +10:00
|
|
|
virtual bool usedCachedLabels() const;
|
2017-12-15 08:57:22 +10:00
|
|
|
|
2017-05-01 16:42:33 +02:00
|
|
|
virtual QgsLabelingResults *takeLabelingResults() /Transfer/;
|
2014-06-22 21:55:09 +07:00
|
|
|
|
2017-05-14 09:48:41 +02:00
|
|
|
|
2017-12-15 08:57:22 +10:00
|
|
|
|
2016-10-24 09:34:13 +10:00
|
|
|
void waitForFinishedWithEventLoop( QEventLoop::ProcessEventsFlags flags = QEventLoop::AllEvents );
|
2017-05-14 09:48:41 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Wait for the job to be finished - and keep the thread's event loop running while waiting.
|
2017-05-14 09:48:41 +02:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
With a call to waitForFinished(), the waiting is done with a synchronization primitive
|
|
|
|
and does not involve processing of messages. That may cause issues to code which requires
|
|
|
|
some events to be handled in the main thread. Some plugins hooking into the rendering
|
|
|
|
pipeline may require this in order to work properly - for example, OpenLayers plugin
|
|
|
|
which uses a QWebPage in the main thread.
|
2017-05-14 09:48:41 +02:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
Ideally the "wait for finished" method should not be used at all. The code triggering
|
|
|
|
rendering should not need to actively wait for rendering to finish.
|
2017-05-14 09:48:41 +02:00
|
|
|
%End
|
2014-06-22 21:55:09 +07:00
|
|
|
|
|
|
|
void renderSynchronously();
|
2017-05-14 09:48:41 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Render the map synchronously in this thread. The function does not return until the map
|
|
|
|
is completely rendered.
|
2017-05-14 09:48:41 +02:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
This is an alternative to ordinary API (using start() + waiting for finished() signal).
|
|
|
|
Users are discouraged to use this method unless they have a strong reason for doing it.
|
|
|
|
The synchronous rendering blocks the main thread, making the application unresponsive.
|
|
|
|
Also, it is not possible to cancel rendering while it is in progress.
|
2017-05-14 09:48:41 +02:00
|
|
|
%End
|
2014-06-22 21:55:09 +07:00
|
|
|
|
|
|
|
};
|
2017-05-14 09:48:41 +02:00
|
|
|
|
|
|
|
|
|
|
|
/************************************************************************
|
|
|
|
* This file has been generated automatically from *
|
|
|
|
* *
|
|
|
|
* src/core/qgsmaprenderercustompainterjob.h *
|
|
|
|
* *
|
|
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
|
|
************************************************************************/
|