Skip to content
Permalink
Browse files

Add missing proxies for legend check behaviour to subrenderers

for inverted polygon and displacement renderers
  • Loading branch information
nyalldawson committed Jun 7, 2016
1 parent b2c43cb commit 7a8d9dd50654a27c4ecaaccfd66974dded6aaaa9
@@ -73,6 +73,10 @@ class QgsPointDisplacementRenderer : QgsFeatureRendererV2

virtual void setLegendSymbolItem( const QString& key, QgsSymbolV2* symbol );

virtual bool legendSymbolItemsCheckable() const;
virtual bool legendSymbolItemChecked( const QString& key );
virtual void checkLegendSymbolItem( const QString& key, bool state = true );

//! not available in python bindings
//! @deprecated since 2.4
// void setDisplacementGroups( const QList<QMap<QgsFeatureId, QgsFeature> >& list );
@@ -72,6 +72,30 @@ void QgsInvertedPolygonRenderer::setLegendSymbolItem( const QString& key, QgsSym
mSubRenderer->setLegendSymbolItem( key, symbol );
}

bool QgsInvertedPolygonRenderer::legendSymbolItemsCheckable() const
{
if ( !mSubRenderer )
return false;

return mSubRenderer->legendSymbolItemsCheckable();
}

bool QgsInvertedPolygonRenderer::legendSymbolItemChecked( const QString& key )
{
if ( !mSubRenderer )
return false;

return mSubRenderer->legendSymbolItemChecked( key );
}

void QgsInvertedPolygonRenderer::checkLegendSymbolItem( const QString& key, bool state )
{
if ( !mSubRenderer )
return;

return mSubRenderer->checkLegendSymbolItem( key, state );
}

void QgsInvertedPolygonRenderer::startRender( QgsRenderContext& context, const QgsFields& fields )
{
if ( !mSubRenderer )
@@ -123,6 +123,10 @@ class CORE_EXPORT QgsInvertedPolygonRenderer : public QgsFeatureRendererV2

virtual void setLegendSymbolItem( const QString& key, QgsSymbolV2* symbol ) override;

virtual bool legendSymbolItemsCheckable() const override;
virtual bool legendSymbolItemChecked( const QString& key ) override;
virtual void checkLegendSymbolItem( const QString& key, bool state = true ) override;

/** @returns true if the geometries are to be preprocessed (merged with an union) before rendering.*/
bool preprocessingEnabled() const { return mPreprocessingEnabled; }
/**
@@ -235,6 +235,30 @@ void QgsPointDisplacementRenderer::setLegendSymbolItem( const QString& key, QgsS
mRenderer->setLegendSymbolItem( key, symbol );
}

bool QgsPointDisplacementRenderer::legendSymbolItemsCheckable() const
{
if ( !mRenderer )
return false;

return mRenderer->legendSymbolItemsCheckable();
}

bool QgsPointDisplacementRenderer::legendSymbolItemChecked( const QString& key )
{
if ( !mRenderer )
return false;

return mRenderer->legendSymbolItemChecked( key );
}

void QgsPointDisplacementRenderer::checkLegendSymbolItem( const QString& key, bool state )
{
if ( !mRenderer )
return;

return mRenderer->checkLegendSymbolItem( key, state );
}

QList<QString> QgsPointDisplacementRenderer::usedAttributes()
{
QList<QString> attributeList;
@@ -100,6 +100,10 @@ class CORE_EXPORT QgsPointDisplacementRenderer: public QgsFeatureRendererV2

virtual void setLegendSymbolItem( const QString& key, QgsSymbolV2* symbol ) override;

virtual bool legendSymbolItemsCheckable() const override;
virtual bool legendSymbolItemChecked( const QString& key ) override;
virtual void checkLegendSymbolItem( const QString& key, bool state = true ) override;

//! not available in python bindings
//! @deprecated since 2.4
Q_DECL_DEPRECATED void setDisplacementGroups( const QList<QMap<QgsFeatureId, QgsFeature> >& list ) { Q_UNUSED( list ); }

0 comments on commit 7a8d9dd

Please sign in to comment.
You can’t perform that action at this time.