Commit 8443abd6 authored by CABEL Tristan's avatar CABEL Tristan

bugfix block signal before clear for plot

parent 7aad66c4
......@@ -270,6 +270,10 @@ dtkVisualizationPlot2D::dtkVisualizationPlot2D(QWidget *parent) : dtkVisualizati
connect(d->field_y, &QListWidget::currentRowChanged, [=] (int currentRow)
{
// it will happen if we call clear on the qlistwidget when a row is selected
if(!d->field_y->item(currentRow))
return;
QString row_text = d->field_y->item(currentRow)->text();
if(d->save_field->isChecked()) {
......@@ -576,8 +580,13 @@ void dtkVisualizationPlot2D::addFieldY(vtkSmartPointer<vtkAbstractArray> field,
void dtkVisualizationPlot2D::clearFields(void)
{
d->field_x->clear();
d->field_y->blockSignals(true);
d->field_y->clear();
d->field_y->blockSignals(false);
d->fields_parameters.clear();
for(vtkIdType i=0; i < d->fields_table->GetNumberOfColumns(); ++i) {
d->fields_table->RemoveColumn(i);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment