diff --git a/GUI/View/Material/MaterialEditorDialog.cpp b/GUI/View/Material/MaterialEditorDialog.cpp index 9aeac23e377f4a7f148137e794ac12e43fc30413..b0b88fd28bdcd9233ad7097084aaa3361499f13e 100644 --- a/GUI/View/Material/MaterialEditorDialog.cpp +++ b/GUI/View/Material/MaterialEditorDialog.cpp @@ -27,7 +27,6 @@ #include <QColorDialog> #include <QDialog> #include <QDialogButtonBox> -#include <QDoubleSpinBox> #include <QFormLayout> #include <QGroupBox> #include <QHBoxLayout> @@ -343,8 +342,8 @@ void MaterialEditorDialog::onSelectMaterial() m_sld_group->hide(); for (auto* lineEdit : m_editor->findChildren<QLineEdit*>()) lineEdit->clear(); - for (auto* spinBox : m_editor->findChildren<QDoubleSpinBox*>()) - spinBox->clear(); + for (auto* spinBox : m_editor->findChildren<DoubleSpinBox*>()) + spinBox->replaceProperty(nullptr); return; } diff --git a/GUI/View/Numeric/NumWidgetUtil.h b/GUI/View/Numeric/NumWidgetUtil.h index 1ad8733f89fbf3291e5c998a15618533b34ba3d3..c19e70784ba3410a168c885d2a3a14eb6a3d0dcb 100644 --- a/GUI/View/Numeric/NumWidgetUtil.h +++ b/GUI/View/Numeric/NumWidgetUtil.h @@ -17,7 +17,6 @@ #include "Fit/Param/RealLimits.h" #include <QCheckBox> -#include <QDoubleSpinBox> #include <QFormLayout> #include <QSpinBox> #include <QString> diff --git a/GUI/View/Numeric/NumberUtil.cpp b/GUI/View/Numeric/NumberUtil.cpp index 590c3f8c75a149d5790eaff4930042f754846093..fca169aa52c9502daaa3043ac532591d17dfabdd 100644 --- a/GUI/View/Numeric/NumberUtil.cpp +++ b/GUI/View/Numeric/NumberUtil.cpp @@ -18,18 +18,6 @@ #include "GUI/View/Numeric/ScientificSpinBox.h" #include <cmath> -namespace { - -//! Single step for QDoubleSpinBox. -double singleStep(int decimals) -{ - // For item with decimals=3 (i.e. 0.001) single step will be 0.1 - return 1. / std::pow(10., decimals - 1); -} - -} // namespace - - void GUI::View::NumberUtil::configScientificDoubleEdit(QLineEdit* edit, const RealLimits& limits) { auto* validator = new QDoubleValidator(0.0, 1e200, 1000, edit); @@ -41,18 +29,3 @@ void GUI::View::NumberUtil::configScientificDoubleEdit(QLineEdit* edit, const Re edit->setValidator(validator); } - -void GUI::View::NumberUtil::configSpinBox(QDoubleSpinBox* spinBox, int decimals, - const RealLimits& limits) -{ - spinBox->setMaximum(std::numeric_limits<double>::max()); - spinBox->setMinimum(std::numeric_limits<double>::lowest()); - - if (limits.hasLowerLimit()) - spinBox->setMinimum(limits.min()); - if (limits.hasUpperLimit()) - spinBox->setMaximum(limits.max()); - - spinBox->setDecimals(decimals); - spinBox->setSingleStep(singleStep(decimals)); -} diff --git a/GUI/View/Numeric/NumberUtil.h b/GUI/View/Numeric/NumberUtil.h index 7f846cdc6417bdc1dce7515dde85664ab8ee5bde..052518ff43cd4273c244e7e88b6e5efeba211e1f 100644 --- a/GUI/View/Numeric/NumberUtil.h +++ b/GUI/View/Numeric/NumberUtil.h @@ -15,7 +15,6 @@ #ifndef BORNAGAIN_GUI_VIEW_NUMERIC_NUMBERUTIL_H #define BORNAGAIN_GUI_VIEW_NUMERIC_NUMBERUTIL_H -#include <QDoubleSpinBox> #include <QLineEdit> class DoubleSpinBox; @@ -26,8 +25,6 @@ namespace GUI::View::NumberUtil { void configScientificDoubleEdit(QLineEdit* edit, const RealLimits& limits); -void configSpinBox(QDoubleSpinBox* spinBox, int decimals, const RealLimits& limits); - } // namespace GUI::View::NumberUtil #endif // BORNAGAIN_GUI_VIEW_NUMERIC_NUMBERUTIL_H diff --git a/GUI/View/ParEdit/CustomEditors.cpp b/GUI/View/ParEdit/CustomEditors.cpp index 62bea657ef506e522935a4bd1e0bfc3f3c1f8b31..1a133fb4a97354b7b21847b9355d9fef3821182a 100644 --- a/GUI/View/ParEdit/CustomEditors.cpp +++ b/GUI/View/ParEdit/CustomEditors.cpp @@ -23,7 +23,7 @@ namespace { -//! Single step for QDoubleSpinBox. +//! Single step for ScientificSpinBoxEditor. double singleStep(int decimals) { diff --git a/GUI/View/Setup/Scale2DEditor.cpp b/GUI/View/Setup/Scale2DEditor.cpp index 16bbc3dea0c6bde49f473571e46369afa4447f52..105a0032e6cfbf698cb329312eadf3e1ab3d92cb 100644 --- a/GUI/View/Setup/Scale2DEditor.cpp +++ b/GUI/View/Setup/Scale2DEditor.cpp @@ -23,7 +23,6 @@ #include "GUI/View/Tool/LayoutUtil.h" #include "GUI/View/Widget/GroupBoxes.h" #include <QCheckBox> -#include <QDoubleSpinBox> #include <QFormLayout> #include <QLineEdit>