Skip to content
Permalink
Browse files

Fix cannot change color of class symbols (fix #15142)

  • Loading branch information
nyalldawson committed Jun 27, 2016
1 parent 5b166a9 commit 45b878331cffa433f051889edc832f3fcf0e098f
@@ -1029,7 +1029,11 @@ void QgsCategorizedSymbolRendererV2Widget::updateSymbolsFromWidget()
Q_FOREACH ( int idx, selectedCats )
{
QgsSymbolV2* newCatSymbol = mCategorizedSymbol->clone();
newCatSymbol->setColor( mRenderer->categories().at( idx ).symbol()->color() );
if ( selectedCats.count() > 1 )
{
//if updating multiple categories, retain the existing category colors
newCatSymbol->setColor( mRenderer->categories().at( idx ).symbol()->color() );
}
mRenderer->updateCategorySymbol( idx, newCatSymbol );
}
emit widgetChanged();
@@ -717,7 +717,11 @@ void QgsGraduatedSymbolRendererV2Widget::updateSymbolsFromWidget()
{
int rangeIdx = idx.row();
QgsSymbolV2* newRangeSymbol = mGraduatedSymbol->clone();
newRangeSymbol->setColor( mRenderer->ranges()[rangeIdx].symbol()->color() );
if ( selectedIndexes.count() > 1 )
{
//if updating multiple ranges, retain the existing range colors
newRangeSymbol->setColor( mRenderer->ranges().at( rangeIdx ).symbol()->color() );
}
mRenderer->updateRangeSymbol( rangeIdx, newRangeSymbol );
}
}

1 comment on commit 45b8783

@nirvn

This comment has been minimized.

Copy link
Contributor

@nirvn nirvn commented on 45b8783 Jun 27, 2016

@nyalldawson , great! I'm wondering whether a similar trick would be needed for size-method graduated symbology.

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