fixed bug where slider widget would signal that it had changed twice
When typing a slider value, it would always signal that it had changed twice. This is obviously unnecessary and is fixed in this commit.
This commit is contained in:
@@ -244,16 +244,16 @@ void SliderBase::LineEditConfirmed()
|
||||
break;
|
||||
}
|
||||
|
||||
// Ensure editor doesn't signal that the focus is lost
|
||||
editor_->blockSignals(true);
|
||||
|
||||
if (is_valid) {
|
||||
SetValue(test_val);
|
||||
|
||||
emit ValueChanged(value_);
|
||||
|
||||
setCurrentWidget(label_);
|
||||
} else {
|
||||
// Ensure the editor focusing out when the messagebox appears does not cause another messagebox
|
||||
editor_->blockSignals(true);
|
||||
|
||||
emit ValueChanged(value_);
|
||||
} else {
|
||||
QMessageBox::critical(this,
|
||||
tr("Invalid Value"),
|
||||
tr("The entered value is not valid for this field."),
|
||||
@@ -261,9 +261,9 @@ void SliderBase::LineEditConfirmed()
|
||||
|
||||
// Refocus editor
|
||||
editor_->setFocus();
|
||||
|
||||
editor_->blockSignals(false);
|
||||
}
|
||||
|
||||
editor_->blockSignals(false);
|
||||
}
|
||||
|
||||
void SliderBase::LineEditCancelled()
|
||||
|
||||
Reference in New Issue
Block a user