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

GUI::Util::createScientificSpinBoxRow rm unused argument 'slot'

parent e5b442b2
No related branches found
No related tags found
1 merge request!2058GUI instrument editor: detector section made more compact
...@@ -34,8 +34,7 @@ DoubleSpinBox* GUI::Util::createDoubleSpinBoxRow(QFormLayout* parentLayout, Doub ...@@ -34,8 +34,7 @@ DoubleSpinBox* GUI::Util::createDoubleSpinBoxRow(QFormLayout* parentLayout, Doub
ScientificSpinBox* GUI::Util::createScientificSpinBox(QFormLayout* parentLayout, ScientificSpinBox* GUI::Util::createScientificSpinBox(QFormLayout* parentLayout,
const DoubleProperty& d, const DoubleProperty& d)
function<void(double)> slot)
{ {
auto* spinBox = new ScientificSpinBox(parentLayout->parentWidget()); auto* spinBox = new ScientificSpinBox(parentLayout->parentWidget());
spinBox->setFocusPolicy(Qt::StrongFocus); spinBox->setFocusPolicy(Qt::StrongFocus);
...@@ -45,9 +44,6 @@ ScientificSpinBox* GUI::Util::createScientificSpinBox(QFormLayout* parentLayout, ...@@ -45,9 +44,6 @@ ScientificSpinBox* GUI::Util::createScientificSpinBox(QFormLayout* parentLayout,
spinBox->setValue(d.value()); spinBox->setValue(d.value());
parentLayout->addRow(d.label() + ":", spinBox); parentLayout->addRow(d.label() + ":", spinBox);
if (slot)
QObject::connect(spinBox, &ScientificSpinBox::valueChanged, [=](double v) { slot(v); });
return spinBox; return spinBox;
} }
......
...@@ -47,10 +47,8 @@ DoubleSpinBox* createDoubleSpinBoxRow(QFormLayout* parentLayout, DoubleProperty& ...@@ -47,10 +47,8 @@ DoubleSpinBox* createDoubleSpinBoxRow(QFormLayout* parentLayout, DoubleProperty&
//! would take place when just scrolling through the form. //! would take place when just scrolling through the form.
//! //!
//! No connections to update the property will be established! Therefore changes in the spin box //! No connections to update the property will be established! Therefore changes in the spin box
//! will *not* be notified to the property. The additional (and optional) slot can be used to be //! will *not* be notified to the property.
//! notified about a value change. ScientificSpinBox* createScientificSpinBox(QFormLayout* parentLayout, const DoubleProperty& d);
ScientificSpinBox* createScientificSpinBox(QFormLayout* parentLayout, const DoubleProperty& d,
std::function<void(double)> slot = nullptr);
//! Creates an updatable checkbox //! Creates an updatable checkbox
QCheckBox* createCheckBox(const QString& title, std::function<bool()> getter, QCheckBox* createCheckBox(const QString& title, std::function<bool()> getter,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment