Skip to content

Commit

Permalink
Merge pull request #570 from ra3xdh/fix_562
Browse files Browse the repository at this point in the history
Fixes tuner crash #562
  • Loading branch information
ra3xdh authored Feb 16, 2024
2 parents afe87e7 + a5f87d2 commit bdc143e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions qucs/dialogs/tuner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ void tunerElement::resetValue()
value->setText(val);
ValueUnitsCombobox->setCurrentIndex(index);
updateSlider();
slotValueChanged();
slotValueChanged(false);
}

/*
Expand Down Expand Up @@ -462,7 +462,7 @@ void tunerElement::slotSliderChanged()
* The control reaches this function when one of the events above is triggered. It checks if the input value is correct, updates it
* and finally runs the simulation
*/
void tunerElement::slotValueChanged()
void tunerElement::slotValueChanged(bool simulate)
{
bool ok;
float v = getValue(ok);
Expand Down Expand Up @@ -501,7 +501,9 @@ void tunerElement::slotValueChanged()

updateSlider();
updateProperty();
emit elementValueUpdated();
if (simulate) {
emit elementValueUpdated();
}
value->blockSignals(false);
ValueUnitsCombobox->blockSignals(false);
}
Expand Down Expand Up @@ -803,6 +805,7 @@ void TunerDialog::slotResetValues()
{
currentElements.at(i)->resetValue();
}
slotElementValueUpdated();
}

void TunerDialog::slotUpdateValues()
Expand Down
2 changes: 1 addition & 1 deletion qucs/dialogs/tuner.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ class tunerElement : public QWidget
void slotMinValueChanged();
void slotMaxValueChanged();
void slotStepChanged();
void slotValueChanged();
void slotValueChanged(bool simulate = true);
void slotDelete();
void slotDownClicked();
void slotUpClicked();
Expand Down

0 comments on commit bdc143e

Please sign in to comment.