From 746e66e42623a5227641afc6acfb6661ca567b55 Mon Sep 17 00:00:00 2001 From: Mikhail Svechnikov <m.svechnikov@fz-juelich.de> Date: Wed, 30 Nov 2022 19:41:13 +0100 Subject: [PATCH] PolarizationAnalysisEditor: --> createSpinBox(DoubleProperty&) --- GUI/View/Instrument/PolarizationAnalysisEditor.cpp | 8 ++++---- GUI/View/Instrument/PolarizationAnalysisEditor.h | 8 ++++---- GUI/View/Mask/MaskEditorPropertyPanel.h | 1 - 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/GUI/View/Instrument/PolarizationAnalysisEditor.cpp b/GUI/View/Instrument/PolarizationAnalysisEditor.cpp index 98682e9ccf7..0462c720a1f 100644 --- a/GUI/View/Instrument/PolarizationAnalysisEditor.cpp +++ b/GUI/View/Instrument/PolarizationAnalysisEditor.cpp @@ -56,10 +56,10 @@ PolarizationAnalysisEditor::PolarizationAnalysisEditor(QWidget* parent, Instrume GroupBoxCollapser::installIntoGroupBox(this); } -DoubleSpinBox* PolarizationAnalysisEditor::createSpinBox(const DoubleDescriptor& d) +DoubleSpinBox* PolarizationAnalysisEditor::createSpinBox(DoubleProperty& d) { auto* sb = new DoubleSpinBox(d); - connect(sb, &DoubleSpinBox::baseValueChanged, [=](double v) { + connect(sb, &DoubleSpinBox::baseValueChanged, [this, &d](double v) { if (d.get() != v) { d.set(v); emit dataChanged(); @@ -68,11 +68,11 @@ DoubleSpinBox* PolarizationAnalysisEditor::createSpinBox(const DoubleDescriptor& return sb; } -void PolarizationAnalysisEditor::addVector(QFormLayout* parentLayout, const VectorProperty& d) +void PolarizationAnalysisEditor::addVector(QFormLayout* parentLayout, VectorProperty& d) { auto* layout = new QHBoxLayout; - const auto add = [&](const DoubleDescriptor& d) { + const auto add = [this, layout](DoubleProperty& d) { layout->addWidget(new QLabel(GUI::Util::labelWithUnit(d) + ":")); layout->addWidget(createSpinBox(d)); }; diff --git a/GUI/View/Instrument/PolarizationAnalysisEditor.h b/GUI/View/Instrument/PolarizationAnalysisEditor.h index a32adb20e3a..5f89ea7e076 100644 --- a/GUI/View/Instrument/PolarizationAnalysisEditor.h +++ b/GUI/View/Instrument/PolarizationAnalysisEditor.h @@ -17,9 +17,9 @@ #include <QGroupBox> -class InstrumentItem; +class DoubleProperty; class DoubleSpinBox; -class DoubleDescriptor; +class InstrumentItem; class QFormLayout; class VectorProperty; @@ -36,8 +36,8 @@ signals: void dataChanged(); private: - DoubleSpinBox* createSpinBox(const DoubleDescriptor& d); - void addVector(QFormLayout* parentLayout, const VectorProperty& d); + DoubleSpinBox* createSpinBox(DoubleProperty& d); + void addVector(QFormLayout* parentLayout, VectorProperty& d); InstrumentItem* m_instrument; }; diff --git a/GUI/View/Mask/MaskEditorPropertyPanel.h b/GUI/View/Mask/MaskEditorPropertyPanel.h index 770d38a790b..5b1d67314a4 100644 --- a/GUI/View/Mask/MaskEditorPropertyPanel.h +++ b/GUI/View/Mask/MaskEditorPropertyPanel.h @@ -27,7 +27,6 @@ class QItemSelectionModel; class IntensityDataItem; class IntensityDataPropertyWidget; class QFormLayout; -class DoubleDescriptor; class MaskItem; //! Tool widget for MaskEditor -- GitLab