Skip to content
Permalink
Browse files

auto updating of categorized rendrer symbols

  • Loading branch information
tecoholic committed Oct 7, 2012
1 parent 70b7c3b commit c10920bcd7ac550cd4a67339fa7211f64b4eadda
@@ -596,3 +596,15 @@ void QgsCategorizedSymbolRendererV2::setSourceColorRamp( QgsVectorColorRampV2* r
delete mSourceColorRamp;
mSourceColorRamp = ramp;
}

void QgsCategorizedSymbolRendererV2::updateSymbols( QgsSymbolV2 * sym )
{
int i = 0;
foreach( QgsRendererCategoryV2 cat, mCategories )
{
QgsSymbolV2* symbol = sym->clone();
symbol->setColor( cat.symbol()->color() );
updateCategorySymbol( i, symbol );
++i;
}
}
@@ -84,6 +84,8 @@ class CORE_EXPORT QgsCategorizedSymbolRendererV2 : public QgsFeatureRendererV2
virtual int capabilities() { return SymbolLevels | RotationField; }

virtual QgsSymbolV2List symbols();
//! @note added in 2.0
void updateSymbols( QgsSymbolV2 * sym );

const QgsCategoryList& categories() { return mCategories; }

@@ -164,6 +164,9 @@ void QgsCategorizedSymbolRendererV2Widget::changeCategorizedSymbol()

mCategorizedSymbol = newSymbol;
updateCategorizedSymbolIcon();

mRenderer->updateSymbols( mCategorizedSymbol );
populateCategories();
}

void QgsCategorizedSymbolRendererV2Widget::updateCategorizedSymbolIcon()

0 comments on commit c10920b

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