Skip to content
Permalink
Browse files
categorized renderer: show category by default (followup 4867b7f)
  • Loading branch information
jef-n committed Jul 4, 2014
1 parent b4edd9d commit 51408e16089411385c96f2185939d1bc8438dc96
@@ -6,7 +6,7 @@ class QgsRendererCategoryV2
public:

//! takes ownership of symbol
QgsRendererCategoryV2( QVariant value, QgsSymbolV2* symbol /Transfer/, QString label, bool render );
QgsRendererCategoryV2( QVariant value, QgsSymbolV2* symbol /Transfer/, QString label, bool render = true );

//! copy constructor
QgsRendererCategoryV2( const QgsRendererCategoryV2& cat );
@@ -752,7 +752,10 @@ bool QgsCategorizedSymbolRendererV2::legendSymbolItemsCheckable() const

bool QgsCategorizedSymbolRendererV2::legendSymbolItemChecked( int index )
{
return index < 0 ? true : mCategories[ index ].renderState();
if( index >= 0 && index < mCategories.size() )
return mCategories[ index ].renderState();
else
return true;
}

void QgsCategorizedSymbolRendererV2::checkLegendSymbolItem( int index, bool state )
@@ -32,7 +32,7 @@ class CORE_EXPORT QgsRendererCategoryV2
QgsRendererCategoryV2( );

//! takes ownership of symbol
QgsRendererCategoryV2( QVariant value, QgsSymbolV2* symbol, QString label, bool render );
QgsRendererCategoryV2( QVariant value, QgsSymbolV2* symbol, QString label, bool render = true );

//! copy constructor
QgsRendererCategoryV2( const QgsRendererCategoryV2& cat );
@@ -156,7 +156,7 @@ class CORE_EXPORT QgsFeatureRendererV2

//! items of symbology items in legend is checked
//! @note added in 2.5
virtual bool legendSymbolItemChecked( int key );
virtual bool legendSymbolItemChecked( int index );

//! item in symbology was checked
//! @note added in 2.5

0 comments on commit 51408e1

Please sign in to comment.