From 7d0072b36f25ea828397280cf93dff603645f65f Mon Sep 17 00:00:00 2001 From: "Joachim Wuttke (o)" <j.wuttke@fz-juelich.de> Date: Tue, 2 Jul 2024 12:31:24 +0200 Subject: [PATCH] replace 'createDoubleSpinBoxRow' by 'addDoubleSpinBoxRow' --- GUI/View/Device/AxisPropertyForm.cpp | 4 ++-- GUI/View/Device/BackgroundForm.cpp | 2 +- GUI/View/Device/DetectorEditor.cpp | 4 ++-- GUI/View/Device/DistributionSelector.cpp | 4 ++-- GUI/View/Device/FootprintForm.cpp | 4 ++-- GUI/View/Device/SpanPropertyForm.cpp | 4 ++-- GUI/View/Numeric/NumWidgetUtil.cpp | 2 +- GUI/View/Numeric/NumWidgetUtil.h | 2 +- 8 files changed, 13 insertions(+), 13 deletions(-) diff --git a/GUI/View/Device/AxisPropertyForm.cpp b/GUI/View/Device/AxisPropertyForm.cpp index a08d8563094..74fea4fae51 100644 --- a/GUI/View/Device/AxisPropertyForm.cpp +++ b/GUI/View/Device/AxisPropertyForm.cpp @@ -38,8 +38,8 @@ AxisPropertyForm::AxisPropertyForm(QWidget* parent, const QString& groupTitle, RealLimits::nonnegative(), nbinsTooltip); layout->addRow("# bins:", m_nbins_spin_box); - m_min_spin_box = GUI::Util::createDoubleSpinBoxRow(layout, axisProperty->min()); - m_max_spin_box = GUI::Util::createDoubleSpinBoxRow(layout, axisProperty->max()); + m_min_spin_box = GUI::Util::addDoubleSpinBoxRow(layout, axisProperty->min()); + m_max_spin_box = GUI::Util::addDoubleSpinBoxRow(layout, axisProperty->max()); connect(m_min_spin_box, &DoubleSpinBox::valueChanged, [this](double v) { if (m_axis_property->min() != v) { diff --git a/GUI/View/Device/BackgroundForm.cpp b/GUI/View/Device/BackgroundForm.cpp index 914c6c41667..9b469971103 100644 --- a/GUI/View/Device/BackgroundForm.cpp +++ b/GUI/View/Device/BackgroundForm.cpp @@ -47,7 +47,7 @@ void BackgroundForm::createBackgroundWidgets() auto* backgroundItem = m_instrument->backgroundItem(); if (auto* p = dynamic_cast<ConstantBackgroundItem*>(backgroundItem)) { - auto* sb = GUI::Util::createDoubleSpinBoxRow(m_form_layout, p->backgroundValue()); + auto* sb = GUI::Util::addDoubleSpinBoxRow(m_form_layout, p->backgroundValue()); sb->setMinimumWidth(150); connect(sb, &DoubleSpinBox::valueChanged, [this, p](double v) { p->setBackgroundValue(v); diff --git a/GUI/View/Device/DetectorEditor.cpp b/GUI/View/Device/DetectorEditor.cpp index b9662b3080a..148882a5c25 100644 --- a/GUI/View/Device/DetectorEditor.cpp +++ b/GUI/View/Device/DetectorEditor.cpp @@ -60,8 +60,8 @@ DetectorEditor::DetectorEditor(QWidget* parent, Scatter2DInstrumentItem* instrIt auto* resFunction = item->resolutionFunctionSelection().certainItem(); if (auto* p = dynamic_cast<ResolutionFunction2DGaussianItem*>(resFunction)) { - auto* sigmaXSpinBox = GUI::Util::createDoubleSpinBoxRow(layout, p->sigmaX()); - auto* sigmaYSpinBox = GUI::Util::createDoubleSpinBoxRow(layout, p->sigmaY()); + auto* sigmaXSpinBox = GUI::Util::addDoubleSpinBoxRow(layout, p->sigmaX()); + auto* sigmaYSpinBox = GUI::Util::addDoubleSpinBoxRow(layout, p->sigmaY()); connect(sigmaXSpinBox, &DoubleSpinBox::valueChanged, [parent, p](double newValue) { p->setSigmaX(newValue); diff --git a/GUI/View/Device/DistributionSelector.cpp b/GUI/View/Device/DistributionSelector.cpp index 4f42b7b2860..33e023e8736 100644 --- a/GUI/View/Device/DistributionSelector.cpp +++ b/GUI/View/Device/DistributionSelector.cpp @@ -111,7 +111,7 @@ void DistributionSelector::createNumSamplesSpinBox(DistributionItem* dist) DoubleSpinBox* DistributionSelector::createSpinBox(DoubleProperty& d) { - auto* sb = GUI::Util::createDoubleSpinBoxRow(m_form_layout, d); + auto* sb = GUI::Util::addDoubleSpinBoxRow(m_form_layout, d); connect(sb, &DoubleSpinBox::valueChanged, [this, &d](double v) { d.setValue(v); emit distributionChanged(); @@ -123,7 +123,7 @@ void DistributionSelector::createMeanSpinBox(DoubleProperty& d) { if (m_mean_config) { if (m_mean_config->scientific) { - auto* sb = GUI::Util::createDoubleSpinBoxRow(m_form_layout, d); + auto* sb = GUI::Util::addDoubleSpinBoxRow(m_form_layout, d); connect(sb, &DoubleSpinBox::valueChanged, [this, &d](double v) { d.setValue(v); emit distributionChanged(); diff --git a/GUI/View/Device/FootprintForm.cpp b/GUI/View/Device/FootprintForm.cpp index d5c6afd800e..5a0cdd90d6f 100644 --- a/GUI/View/Device/FootprintForm.cpp +++ b/GUI/View/Device/FootprintForm.cpp @@ -48,14 +48,14 @@ void FootprintForm::updateFootprintWidgets() int sb_width = 134; auto* footprintItem = m_item->footprintSelection().certainItem(); if (auto* sqr = dynamic_cast<FootprintSquareItem*>(footprintItem)) { - auto* sb = GUI::Util::createDoubleSpinBoxRow(m_form_layout, sqr->squareFootprintValue()); + auto* sb = GUI::Util::addDoubleSpinBoxRow(m_form_layout, sqr->squareFootprintValue()); sb->setMinimumWidth(sb_width); connect(sb, &DoubleSpinBox::valueChanged, [this, sqr](double v) { sqr->setSquareFootprintValue(v); emit dataChanged(); }); } else if (auto* gs = dynamic_cast<FootprintGaussianItem*>(footprintItem)) { - auto* sb = GUI::Util::createDoubleSpinBoxRow(m_form_layout, gs->gaussianFootprintValue()); + auto* sb = GUI::Util::addDoubleSpinBoxRow(m_form_layout, gs->gaussianFootprintValue()); sb->setMinimumWidth(sb_width); connect(sb, &DoubleSpinBox::valueChanged, [this, gs](double v) { gs->setGaussianFootprintValue(v); diff --git a/GUI/View/Device/SpanPropertyForm.cpp b/GUI/View/Device/SpanPropertyForm.cpp index 30bb3e7b140..77257dd85c3 100644 --- a/GUI/View/Device/SpanPropertyForm.cpp +++ b/GUI/View/Device/SpanPropertyForm.cpp @@ -39,8 +39,8 @@ SpanPropertyForm::SpanPropertyForm(QWidget* parent, const QString& group_title, RealLimits::limited(1, 1 << 15), nbins_tooltip, &m_updaters); layout->addRow("# bins:", m_nbins_spin_box); - m_width_spin_box = GUI::Util::createDoubleSpinBoxRow(layout, m_span_property->width()); - m_center_spin_box = GUI::Util::createDoubleSpinBoxRow(layout, m_span_property->center()); + m_width_spin_box = GUI::Util::addDoubleSpinBoxRow(layout, m_span_property->width()); + m_center_spin_box = GUI::Util::addDoubleSpinBoxRow(layout, m_span_property->center()); connect(m_width_spin_box, &DoubleSpinBox::valueChanged, [this](double v) { ASSERT(v >= 0); // spin box should have got limits from property diff --git a/GUI/View/Numeric/NumWidgetUtil.cpp b/GUI/View/Numeric/NumWidgetUtil.cpp index 4e6228f5eb2..31b659fc0e9 100644 --- a/GUI/View/Numeric/NumWidgetUtil.cpp +++ b/GUI/View/Numeric/NumWidgetUtil.cpp @@ -19,7 +19,7 @@ #include <QLabel> #include <QLineEdit> -DoubleSpinBox* GUI::Util::createDoubleSpinBoxRow(QFormLayout* parentLayout, DoubleProperty& d) +DoubleSpinBox* GUI::Util::addDoubleSpinBoxRow(QFormLayout* parentLayout, DoubleProperty& d) { auto* sb = new DoubleSpinBox(&d); parentLayout->addRow(d.label() + ":", sb); diff --git a/GUI/View/Numeric/NumWidgetUtil.h b/GUI/View/Numeric/NumWidgetUtil.h index 956117a9649..972f3b2e6f7 100644 --- a/GUI/View/Numeric/NumWidgetUtil.h +++ b/GUI/View/Numeric/NumWidgetUtil.h @@ -37,7 +37,7 @@ namespace GUI::Util { //! //! No connections to update the property will be established! Therefore changes in the spin box //! will *not* be notified to the property. -DoubleSpinBox* createDoubleSpinBoxRow(QFormLayout* parentLayout, DoubleProperty& d); +DoubleSpinBox* addDoubleSpinBoxRow(QFormLayout* parentLayout, DoubleProperty& d); //! Creates an updatable checkbox QCheckBox* createCheckBox(const QString& title, std::function<bool()> getter, -- GitLab