mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-25 00:58:06 -05:00
Fix cannot change color of class symbols (fix #15142)
This commit is contained in:
parent
5b166a9d6b
commit
45b878331c
@ -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 );
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user