Skip to content
Permalink
Browse files
Also add signal for when layer rendering starts
  • Loading branch information
nyalldawson committed Dec 31, 2021
1 parent 79d5065 commit dbff1e16cc269247315c5fa1c16a6df1c339c9fa
@@ -191,6 +191,18 @@ Rendering labels is not yet done. If the fully rendered layer including labels i
.. versionadded:: 3.0
%End


void layerRenderingStarted( const QString &layerId );
%Docstring
Emitted just before rendering starts for a particular layer.

.. note::

the :py:class:`QgsMapRendererParallelJob` subclass does not emit this signal.

.. versionadded:: 3.24
%End

void layerRendered( const QString &layerId );
%Docstring
Emitted when a layer has completed rendering.
@@ -295,6 +295,8 @@ void QgsMapRendererCustomPainterJob::doRender()
if ( job.context()->renderingStopped() )
break;

emit layerRenderingStarted( job.layerId );

if ( ! hasSecondPass && job.context()->useAdvancedEffects() )
{
// Set the QPainter composition mode so that this layer is rendered using
@@ -431,6 +431,16 @@ class CORE_EXPORT QgsMapRendererJob : public QObject SIP_ABSTRACT
*/
void renderingLayersFinished();


/**
* Emitted just before rendering starts for a particular layer.
*
* \note the QgsMapRendererParallelJob subclass does not emit this signal.
*
* \since QGIS 3.24
*/
void layerRenderingStarted( const QString &layerId );

/**
* Emitted when a layer has completed rendering.
*
@@ -71,6 +71,7 @@ void QgsMapRendererSequentialJob::startPrivate()

connect( mInternalJob, &QgsMapRendererJob::finished, this, &QgsMapRendererSequentialJob::internalFinished );
connect( mInternalJob, &QgsMapRendererJob::layerRendered, this, &QgsMapRendererSequentialJob::layerRendered );
connect( mInternalJob, &QgsMapRendererJob::layerRenderingStarted, this, &QgsMapRendererSequentialJob::layerRenderingStarted );

mInternalJob->start();
}
@@ -103,6 +103,7 @@ bool QgsMapRendererStagedRenderJob::renderCurrentPart( QPainter *painter )
if ( mJobIt != mLayerJobs.end() )
{
LayerRenderJob &job = *mJobIt;
emit layerRenderingStarted( job.layerId );
job.renderer->renderContext()->setPainter( painter );

if ( job.context()->useAdvancedEffects() )

0 comments on commit dbff1e1

Please sign in to comment.