From ac6ed1a18c67b04301983569fe8336f95574e88d Mon Sep 17 00:00:00 2001 From: Matthias Kuhn Date: Tue, 30 Apr 2019 15:04:15 +0200 Subject: [PATCH] Doxygen for QgsSymbolLayer::setRenderingPass --- .../symbology/qgssymbollayer.sip.in | 13 ++++++++++++ src/core/symbology/qgssymbollayer.cpp | 11 +++++++++- src/core/symbology/qgssymbollayer.h | 20 +++++++++++++++---- 3 files changed, 39 insertions(+), 5 deletions(-) diff --git a/python/core/auto_generated/symbology/qgssymbollayer.sip.in b/python/core/auto_generated/symbology/qgssymbollayer.sip.in index 3f60f7b7bea..784a0e4fc45 100644 --- a/python/core/auto_generated/symbology/qgssymbollayer.sip.in +++ b/python/core/auto_generated/symbology/qgssymbollayer.sip.in @@ -288,7 +288,20 @@ layer may use it to specify the units for the line width. virtual QgsMapUnitScale mapUnitScale() const; void setRenderingPass( int renderingPass ); +%Docstring +Specifies the rendering pass in which this symbol layer should be rendered. +The lower the number, the lower the symbol will be rendered. +0: first pass, 1: second pass, ... +Defaults to 0 +%End + int renderingPass() const; +%Docstring +Specifies the rendering pass in which this symbol layer should be rendered. +The lower the number, the lower the symbol will be rendered. +0: first pass, 1: second pass, ... +Defaults to 0 +%End virtual QSet usedAttributes( const QgsRenderContext &context ) const; %Docstring diff --git a/src/core/symbology/qgssymbollayer.cpp b/src/core/symbology/qgssymbollayer.cpp index bdd765030b3..7a524011624 100644 --- a/src/core/symbology/qgssymbollayer.cpp +++ b/src/core/symbology/qgssymbollayer.cpp @@ -176,7 +176,6 @@ QgsSymbolLayer::QgsSymbolLayer( QgsSymbol::SymbolType type, bool locked ) : mType( type ) , mEnabled( true ) , mLocked( locked ) - , mRenderingPass( 0 ) { mPaintEffect = QgsPaintEffectRegistry::defaultStack(); @@ -218,6 +217,16 @@ bool QgsSymbolLayer::isCompatibleWithSymbol( QgsSymbol *symbol ) const return symbol->type() == mType; } +void QgsSymbolLayer::setRenderingPass( int renderingPass ) +{ + mRenderingPass = renderingPass; +} + +int QgsSymbolLayer::renderingPass() const +{ + return mRenderingPass; +} + QSet QgsSymbolLayer::usedAttributes( const QgsRenderContext &context ) const { QSet columns = mDataDefinedProperties.referencedFields( context.expressionContext() ); diff --git a/src/core/symbology/qgssymbollayer.h b/src/core/symbology/qgssymbollayer.h index 2ca4e928666..8f5bd3ad3f7 100644 --- a/src/core/symbology/qgssymbollayer.h +++ b/src/core/symbology/qgssymbollayer.h @@ -308,9 +308,21 @@ class CORE_EXPORT QgsSymbolLayer virtual void setMapUnitScale( const QgsMapUnitScale &scale ) { Q_UNUSED( scale ); } virtual QgsMapUnitScale mapUnitScale() const { return QgsMapUnitScale(); } - // used only with rending with symbol levels is turned on (0 = first pass, 1 = second, ...) - void setRenderingPass( int renderingPass ) { mRenderingPass = renderingPass; } - int renderingPass() const { return mRenderingPass; } + /** + * Specifies the rendering pass in which this symbol layer should be rendered. + * The lower the number, the lower the symbol will be rendered. + * 0: first pass, 1: second pass, ... + * Defaults to 0 + */ + void setRenderingPass( int renderingPass ); + + /** + * Specifies the rendering pass in which this symbol layer should be rendered. + * The lower the number, the lower the symbol will be rendered. + * 0: first pass, 1: second pass, ... + * Defaults to 0 + */ + int renderingPass() const; /** * Returns the set of attributes referenced by the layer. This includes attributes @@ -419,7 +431,7 @@ class CORE_EXPORT QgsSymbolLayer bool mLocked; QColor mColor; - int mRenderingPass; + int mRenderingPass = 0; QgsPropertyCollection mDataDefinedProperties;