Skip to content
Snippets Groups Projects
Commit 185ddd42 authored by Wuttke, Joachim's avatar Wuttke, Joachim Committed by Wuttke, Joachim
Browse files

private fct -> lambda

parent e0560656
No related branches found
No related tags found
1 merge request!2205rewrite DoubleSpinBox; use DoubleSpinBox for intensity; simplify RealLimits (#870)
......@@ -49,8 +49,11 @@ DoubleSpinBox::DoubleSpinBox(DoubleProperty& d)
QSignalBlocker b(this);
lineEdit()->setText(toString(m_valueProperty.value()));
QObject::connect(this, &QAbstractSpinBox::editingFinished, this,
&DoubleSpinBox::onDisplayValueChanged);
QObject::connect(this, &QAbstractSpinBox::editingFinished, [this]() {
double val;
ASSERT(Base::String::to_double(lineEdit()->text().toStdString(), &val));
setValue(val);
});
// setSingleStep(m_valueProperty.step());
}
......@@ -82,13 +85,6 @@ void DoubleSpinBox::stepBy(int steps)
setValue(m_valueProperty / 1.2);
}
void DoubleSpinBox::onDisplayValueChanged()
{
double val;
ASSERT(Base::String::to_double(lineEdit()->text().toStdString(), &val));
setValue(val);
}
void DoubleSpinBox::updateValue()
{
QSignalBlocker _(this);
......
......@@ -31,7 +31,6 @@ public:
//! unnoticed changes would take place when just scrolling through the form.
DoubleSpinBox(DoubleProperty& d);
//! Update the shown value to the one contained in the value descriptor.
//!
//! No signal will be emitted if the new value has changed.
......@@ -46,7 +45,6 @@ private:
void setValue(double val);
void wheelEvent(QWheelEvent* event) override;
void stepBy(int steps) override;
void onDisplayValueChanged();
DoubleProperty& m_valueProperty;
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment