Skip to content

Commit

Permalink
QgsSymbol::start/stopFeatureRender needs to be public so python subcl…
Browse files Browse the repository at this point in the history
…asses can call it
  • Loading branch information
nyalldawson committed Mar 31, 2021
1 parent f6b4717 commit ce5558e
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 28 deletions.
26 changes: 26 additions & 0 deletions python/core/auto_generated/symbology/qgssymbol.sip.in
Expand Up @@ -612,6 +612,32 @@ the rendering process. After rendering all features :py:func:`~QgsSymbol.stopRen
Returns the symbol render context. Only valid between startRender and stopRender calls.

:return: The symbol render context
%End

void startFeatureRender( const QgsFeature &feature, QgsRenderContext &context, int layer = -1 );
%Docstring
Called before symbol layers will be rendered for a particular ``feature``.

This is always followed by a call to :py:func:`~QgsSymbol.stopFeatureRender` after the feature
has been completely rendered (i.e. all parts have been rendered).

Internally, this notifies all symbol layers which will be used via a call to
:py:func:`QgsSymbolLayer.startFeatureRender()`.

.. versionadded:: 3.20
%End

void stopFeatureRender( const QgsFeature &feature, QgsRenderContext &context, int layer = -1 );
%Docstring
Called after symbol layers have been rendered for a particular ``feature``.

This is always preceded by a call to :py:func:`~QgsSymbol.startFeatureRender` just before the feature
will be rendered.

Internally, this notifies all symbol layers which were used via a call to
:py:func:`QgsSymbolLayer.stopFeatureRender()`.

.. versionadded:: 3.20
%End

protected:
Expand Down
54 changes: 26 additions & 28 deletions src/core/symbology/qgssymbol.h
Expand Up @@ -638,6 +638,32 @@ class CORE_EXPORT QgsSymbol
*/
QgsSymbolRenderContext *symbolRenderContext();

/**
* Called before symbol layers will be rendered for a particular \a feature.
*
* This is always followed by a call to stopFeatureRender() after the feature
* has been completely rendered (i.e. all parts have been rendered).
*
* Internally, this notifies all symbol layers which will be used via a call to
* QgsSymbolLayer::startFeatureRender().
*
* \since QGIS 3.20
*/
void startFeatureRender( const QgsFeature &feature, QgsRenderContext &context, int layer = -1 );

/**
* Called after symbol layers have been rendered for a particular \a feature.
*
* This is always preceded by a call to startFeatureRender() just before the feature
* will be rendered.
*
* Internally, this notifies all symbol layers which were used via a call to
* QgsSymbolLayer::stopFeatureRender().
*
* \since QGIS 3.20
*/
void stopFeatureRender( const QgsFeature &feature, QgsRenderContext &context, int layer = -1 );

protected:
QgsSymbol( SymbolType type, const QgsSymbolLayerList &layers SIP_TRANSFER ); // can't be instantiated

Expand Down Expand Up @@ -741,34 +767,6 @@ class CORE_EXPORT QgsSymbol

QgsPropertyCollection mDataDefinedProperties;

/**
* Called before symbol layers will be rendered for a particular \a feature.
*
* This is always followed by a call to stopFeatureRender() after the feature
* has been completely rendered (i.e. all parts have been rendered).
*
* Internally, this notifies all symbol layers which will be used via a call to
* QgsSymbolLayer::startFeatureRender().
*
* \since QGIS 3.12
*/
void startFeatureRender( const QgsFeature &feature, QgsRenderContext &context, int layer = -1 );

/**
* Called after symbol layers have been rendered for a particular \a feature.
*
* This is always preceded by a call to startFeatureRender() just before the feature
* will be rendered.
*
* Internally, this notifies all symbol layers which were used via a call to
* QgsSymbolLayer::stopFeatureRender().
*
* \since QGIS 3.12
*/
void stopFeatureRender( const QgsFeature &feature, QgsRenderContext &context, int layer = -1 );

friend class QgsSymbolLayer;

Q_DISABLE_COPY( QgsSymbol )

};
Expand Down

0 comments on commit ce5558e

Please sign in to comment.