Skip to content
Snippets Groups Projects
Commit 320292e3 authored by Mikhail Svechnikov's avatar Mikhail Svechnikov
Browse files

WidgetUtils: rm createDoubleSpinboxUpdScroll

parent 522ff8d4
No related branches found
No related tags found
1 merge request!996GUI: remove Descriptors from MinimizerItems
...@@ -83,7 +83,7 @@ void IntensityDataPropertyWidget::createPanelElements() ...@@ -83,7 +83,7 @@ void IntensityDataPropertyWidget::createPanelElements()
xFormLayout->setContentsMargins(0, 0, 0, 0); xFormLayout->setContentsMargins(0, 0, 0, 0);
xFormLayout->setSpacing(5); xFormLayout->setSpacing(5);
xFormLayout->addRow("Min:", GUI::Util::createDoubleSpinboxUpdScroll( xFormLayout->addRow("Min:", GUI::Util::createDoubleSpinbox(
[=] { return currentIntensityDataItem()->xAxisItem()->min(); }, [=] { return currentIntensityDataItem()->xAxisItem()->min(); },
[=](double newValue) { [=](double newValue) {
for (auto item : allIntensityDataItems()) for (auto item : allIntensityDataItems())
...@@ -91,7 +91,7 @@ void IntensityDataPropertyWidget::createPanelElements() ...@@ -91,7 +91,7 @@ void IntensityDataPropertyWidget::createPanelElements()
}, },
&m_updaters)); &m_updaters));
xFormLayout->addRow("Max:", GUI::Util::createDoubleSpinboxUpdScroll( xFormLayout->addRow("Max:", GUI::Util::createDoubleSpinbox(
[=] { return currentIntensityDataItem()->xAxisItem()->max(); }, [=] { return currentIntensityDataItem()->xAxisItem()->max(); },
[=](double newValue) { [=](double newValue) {
for (auto item : allIntensityDataItems()) for (auto item : allIntensityDataItems())
...@@ -116,7 +116,7 @@ void IntensityDataPropertyWidget::createPanelElements() ...@@ -116,7 +116,7 @@ void IntensityDataPropertyWidget::createPanelElements()
yFormLayout->setContentsMargins(0, 0, 0, 0); yFormLayout->setContentsMargins(0, 0, 0, 0);
yFormLayout->setSpacing(5); yFormLayout->setSpacing(5);
yFormLayout->addRow("Min:", GUI::Util::createDoubleSpinboxUpdScroll( yFormLayout->addRow("Min:", GUI::Util::createDoubleSpinbox(
[=] { return currentIntensityDataItem()->yAxisItem()->min(); }, [=] { return currentIntensityDataItem()->yAxisItem()->min(); },
[=](double newValue) { [=](double newValue) {
for (auto item : allIntensityDataItems()) for (auto item : allIntensityDataItems())
...@@ -124,7 +124,7 @@ void IntensityDataPropertyWidget::createPanelElements() ...@@ -124,7 +124,7 @@ void IntensityDataPropertyWidget::createPanelElements()
}, },
&m_updaters)); &m_updaters));
yFormLayout->addRow("Max:", GUI::Util::createDoubleSpinboxUpdScroll( yFormLayout->addRow("Max:", GUI::Util::createDoubleSpinbox(
[=] { return currentIntensityDataItem()->yAxisItem()->max(); }, [=] { return currentIntensityDataItem()->yAxisItem()->max(); },
[=](double newValue) { [=](double newValue) {
for (auto item : allIntensityDataItems()) for (auto item : allIntensityDataItems())
...@@ -149,7 +149,7 @@ void IntensityDataPropertyWidget::createPanelElements() ...@@ -149,7 +149,7 @@ void IntensityDataPropertyWidget::createPanelElements()
zFormLayout->setContentsMargins(0, 0, 0, 0); zFormLayout->setContentsMargins(0, 0, 0, 0);
zFormLayout->setSpacing(5); zFormLayout->setSpacing(5);
zFormLayout->addRow("Min:", GUI::Util::createDoubleSpinboxUpdScroll( zFormLayout->addRow("Min:", GUI::Util::createDoubleSpinbox(
[=] { return currentIntensityDataItem()->zAxisItem()->min(); }, [=] { return currentIntensityDataItem()->zAxisItem()->min(); },
[=](double newValue) { [=](double newValue) {
for (auto item : allIntensityDataItems()) for (auto item : allIntensityDataItems())
...@@ -157,7 +157,7 @@ void IntensityDataPropertyWidget::createPanelElements() ...@@ -157,7 +157,7 @@ void IntensityDataPropertyWidget::createPanelElements()
}, },
&m_updaters)); &m_updaters));
zFormLayout->addRow("Max:", GUI::Util::createDoubleSpinboxUpdScroll( zFormLayout->addRow("Max:", GUI::Util::createDoubleSpinbox(
[=] { return currentIntensityDataItem()->zAxisItem()->max(); }, [=] { return currentIntensityDataItem()->zAxisItem()->max(); },
[=](double newValue) { [=](double newValue) {
for (auto item : mainIntensityDataItems()) for (auto item : mainIntensityDataItems())
......
...@@ -58,7 +58,7 @@ void SpecularDataPropertyWidget::createPanelElements() ...@@ -58,7 +58,7 @@ void SpecularDataPropertyWidget::createPanelElements()
xFormLayout->setContentsMargins(0, 0, 0, 0); xFormLayout->setContentsMargins(0, 0, 0, 0);
xFormLayout->setSpacing(5); xFormLayout->setSpacing(5);
xFormLayout->addRow("Min:", GUI::Util::createDoubleSpinboxUpdScroll( xFormLayout->addRow("Min:", GUI::Util::createDoubleSpinbox(
[=] { return currentSpecularDataItem()->xAxisItem()->min(); }, [=] { return currentSpecularDataItem()->xAxisItem()->min(); },
[=](double newValue) { [=](double newValue) {
for (auto item : allSpecularDataItems()) for (auto item : allSpecularDataItems())
...@@ -66,7 +66,7 @@ void SpecularDataPropertyWidget::createPanelElements() ...@@ -66,7 +66,7 @@ void SpecularDataPropertyWidget::createPanelElements()
}, },
&m_updaters)); &m_updaters));
xFormLayout->addRow("Max:", GUI::Util::createDoubleSpinboxUpdScroll( xFormLayout->addRow("Max:", GUI::Util::createDoubleSpinbox(
[=] { return currentSpecularDataItem()->xAxisItem()->max(); }, [=] { return currentSpecularDataItem()->xAxisItem()->max(); },
[=](double newValue) { [=](double newValue) {
for (auto item : allSpecularDataItems()) for (auto item : allSpecularDataItems())
...@@ -91,7 +91,7 @@ void SpecularDataPropertyWidget::createPanelElements() ...@@ -91,7 +91,7 @@ void SpecularDataPropertyWidget::createPanelElements()
yFormLayout->setContentsMargins(0, 0, 0, 0); yFormLayout->setContentsMargins(0, 0, 0, 0);
yFormLayout->setSpacing(5); yFormLayout->setSpacing(5);
yFormLayout->addRow("Min:", GUI::Util::createDoubleSpinboxUpdScroll( yFormLayout->addRow("Min:", GUI::Util::createDoubleSpinbox(
[=] { return currentSpecularDataItem()->yAxisItem()->min(); }, [=] { return currentSpecularDataItem()->yAxisItem()->min(); },
[=](double newValue) { [=](double newValue) {
for (auto item : mainSpecularDataItems()) for (auto item : mainSpecularDataItems())
...@@ -99,7 +99,7 @@ void SpecularDataPropertyWidget::createPanelElements() ...@@ -99,7 +99,7 @@ void SpecularDataPropertyWidget::createPanelElements()
}, },
&m_updaters)); &m_updaters));
yFormLayout->addRow("Max:", GUI::Util::createDoubleSpinboxUpdScroll( yFormLayout->addRow("Max:", GUI::Util::createDoubleSpinbox(
[=] { return currentSpecularDataItem()->yAxisItem()->max(); }, [=] { return currentSpecularDataItem()->yAxisItem()->max(); },
[=](double newValue) { [=](double newValue) {
for (auto item : mainSpecularDataItems()) for (auto item : mainSpecularDataItems())
......
...@@ -233,13 +233,6 @@ QDoubleSpinBox* GUI::Util::createDoubleSpinbox(function<double()> getter, ...@@ -233,13 +233,6 @@ QDoubleSpinBox* GUI::Util::createDoubleSpinbox(function<double()> getter,
return spin; return spin;
} }
QDoubleSpinBox* GUI::Util::createDoubleSpinboxUpdScroll(function<double()> getter,
function<void(double)> slot,
QList<function<void()>>* updaters)
{
return GUI::Util::createDoubleSpinbox(getter, slot, updaters, true);
}
QSpinBox *GUI::Util::createIntSpinbox(std::function<int ()> getter, QSpinBox *GUI::Util::createIntSpinbox(std::function<int ()> getter,
std::function<void (int)> slot, std::function<void (int)> slot,
QList<std::function<void ()> > *updaters, QList<std::function<void ()> > *updaters,
......
...@@ -195,12 +195,8 @@ QSpinBox *createIntSpinbox(std::function<int ()> getter, ...@@ -195,12 +195,8 @@ QSpinBox *createIntSpinbox(std::function<int ()> getter,
//! Creates a scrollable updatable doublespinBox //! Creates a scrollable updatable doublespinBox
QDoubleSpinBox* createDoubleSpinbox(std::function<double()> getter, QDoubleSpinBox* createDoubleSpinbox(std::function<double()> getter,
std::function<void(double)> slot, std::function<void(double)> slot,
QList<std::function<void()>>* updaters, bool easyScrollable); QList<std::function<void()>>* updaters,
bool easyScrollable = true);
//! Creates a doublespinBox with enabled scrolling
QDoubleSpinBox* createDoubleSpinboxUpdScroll(std::function<double()> getter,
std::function<void(double)> slot,
QList<std::function<void()>>* updaters);
} // namespace GUI::Util } // namespace GUI::Util
#endif // BORNAGAIN_GUI_VIEW_TOOL_WIDGETUTILS_H #endif // BORNAGAIN_GUI_VIEW_TOOL_WIDGETUTILS_H
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