Skip to content
Permalink
Browse files

[bugfix]Changing a range or category symbol should not update the [Ch…

…ange] button's (Fixes #17902)

Also avoid modification of the *Change* button if the dialog is not accepted
  • Loading branch information
DelazJ committed Apr 30, 2018
1 parent ee417aa commit 89c2b4bd088452426d01c77569eb3534c099ee2e
@@ -550,11 +550,15 @@ void QgsCategorizedSymbolRendererWidget::changeCategorizedSymbol()

connect( dlg, &QgsPanelWidget::widgetChanged, this, &QgsCategorizedSymbolRendererWidget::updateSymbolsFromWidget );
connect( dlg, &QgsPanelWidget::panelAccepted, this, &QgsCategorizedSymbolRendererWidget::cleanUpSymbolSelector );
connect( dlg, &QgsPanelWidget::panelAccepted, this, &QgsCategorizedSymbolRendererWidget::updateCategorizedSymbolIcon );
openPanel( dlg );
}

void QgsCategorizedSymbolRendererWidget::updateCategorizedSymbolIcon()
{
if ( !mCategorizedSymbol )
return;

QIcon icon = QgsSymbolLayerUtils::symbolPreviewIcon( mCategorizedSymbol.get(), btnChangeCategorizedSymbol->iconSize() );
btnChangeCategorizedSymbol->setIcon( icon );
}
@@ -950,7 +954,6 @@ void QgsCategorizedSymbolRendererWidget::updateSymbolsFromWidget()
QgsSymbolSelectorWidget *dlg = qobject_cast<QgsSymbolSelectorWidget *>( sender() );
mCategorizedSymbol.reset( dlg->symbol()->clone() );

updateCategorizedSymbolIcon();
// When there is a selection, change the selected symbols only
QItemSelectionModel *m = viewCategories->selectionModel();
QModelIndexList i = m->selectedRows();
@@ -973,10 +976,12 @@ void QgsCategorizedSymbolRendererWidget::updateSymbolsFromWidget()
}
emit widgetChanged();
}
return;
}
else
{
mRenderer->updateSymbols( mCategorizedSymbol.get() );
}

mRenderer->updateSymbols( mCategorizedSymbol.get() );
emit widgetChanged();
}

@@ -780,7 +780,6 @@ void QgsGraduatedSymbolRendererWidget::updateSymbolsFromWidget()
}
else
{
updateGraduatedSymbolIcon();
mRenderer->updateSymbols( mGraduatedSymbol.get() );
}

@@ -880,6 +879,7 @@ void QgsGraduatedSymbolRendererWidget::changeGraduatedSymbol()

connect( dlg, &QgsPanelWidget::widgetChanged, this, &QgsGraduatedSymbolRendererWidget::updateSymbolsFromWidget );
connect( dlg, &QgsPanelWidget::panelAccepted, this, &QgsGraduatedSymbolRendererWidget::cleanUpSymbolSelector );
connect( dlg, &QgsPanelWidget::panelAccepted, this, &QgsGraduatedSymbolRendererWidget::updateGraduatedSymbolIcon );
openPanel( dlg );
}

0 comments on commit 89c2b4b

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