diff --git a/GUI/View/Instrument/PolarizationAnalysisEditor.cpp b/GUI/View/Instrument/PolarizationAnalysisEditor.cpp index e8b56bca05bd5707bca8e944ca1c20e7879a7953..61915105da32d49f2d5621c2bb041a3e7e997d90 100644 --- a/GUI/View/Instrument/PolarizationAnalysisEditor.cpp +++ b/GUI/View/Instrument/PolarizationAnalysisEditor.cpp @@ -27,25 +27,51 @@ PolarizationAnalysisEditor::PolarizationAnalysisEditor(QWidget* parent, Instrume auto* layout = new QVBoxLayout(this); - auto* checkbox = new QCheckBox(QString("Enable %1").arg(title())); - checkbox->setChecked(m_instrument->withPolarizerAnalyzer()); - layout->addWidget(checkbox); + // polarizer + { + auto* polarizerCheckbox = new QCheckBox("Enable beam polarization"); + polarizerCheckbox->setChecked(m_instrument->withPolarizer()); + layout->addWidget(polarizerCheckbox); - auto* polarizerAnalyzerWidget = new QWidget(this); - auto* formlayout = new QFormLayout(polarizerAnalyzerWidget); - formlayout->setFieldGrowthPolicy(QFormLayout::FieldsStayAtSizeHint); + auto* polarizerWidget = new QWidget(this); + auto* polarizerLayout = new QFormLayout(polarizerWidget); + polarizerLayout->setFieldGrowthPolicy(QFormLayout::FieldsStayAtSizeHint); - addPolarizerRow(formlayout, m_instrument->polarizerBlochVector()); - addPolarizerRow(formlayout, m_instrument->analyzerBlochVector()); + addPolarizerRow(polarizerLayout, m_instrument->polarizerBlochVector()); - layout->addWidget(polarizerAnalyzerWidget); - polarizerAnalyzerWidget->setVisible(m_instrument->withPolarizerAnalyzer()); + layout->addWidget(polarizerWidget); + polarizerWidget->setVisible(m_instrument->withPolarizer()); - connect(checkbox, &QCheckBox::toggled, [this, polarizerAnalyzerWidget](bool b) { - polarizerAnalyzerWidget->setVisible(b); - m_instrument->setWithPolarizerAnalyzer(b); - emit dataChanged(); - }); + connect(polarizerCheckbox, &QCheckBox::toggled, [this, polarizerWidget](bool b) { + polarizerWidget->setVisible(b); + m_instrument->setWithPolarizer(b); + emit dataChanged(); + }); + } + + // analyzer + { + auto* analyzerCheckbox = new QCheckBox("Enable analyzer"); + analyzerCheckbox->setChecked(m_instrument->withPolarizer()); + layout->addWidget(analyzerCheckbox); + + auto* analyzerWidget = new QWidget(this); + auto* analyzerLayout = new QFormLayout(analyzerWidget); + analyzerLayout->setFieldGrowthPolicy(QFormLayout::FieldsStayAtSizeHint); + + addPolarizerRow(analyzerLayout, m_instrument->analyzerBlochVector()); + + layout->addWidget(analyzerWidget); + analyzerWidget->setVisible(m_instrument->withPolarizer()); + + connect(analyzerCheckbox, &QCheckBox::toggled, [this, analyzerWidget](bool b) { + analyzerWidget->setVisible(b); + m_instrument->setWithAnalyzer(b); + emit dataChanged(); + }); + } + + // collapser auto* collapser = GroupBoxCollapser::installIntoGroupBox(this); collapser->setExpanded(instrument->isExpandPolarizerAlanyzer());