Skip to content
Snippets Groups Projects
Commit 24b4e7dc authored by Mikhail Svechnikov's avatar Mikhail Svechnikov Committed by Wuttke, Joachim
Browse files

upd gui forms

parent 85dd1415
No related branches found
No related tags found
No related merge requests found
...@@ -27,25 +27,51 @@ PolarizationAnalysisEditor::PolarizationAnalysisEditor(QWidget* parent, Instrume ...@@ -27,25 +27,51 @@ PolarizationAnalysisEditor::PolarizationAnalysisEditor(QWidget* parent, Instrume
auto* layout = new QVBoxLayout(this); auto* layout = new QVBoxLayout(this);
auto* checkbox = new QCheckBox(QString("Enable %1").arg(title())); // polarizer
checkbox->setChecked(m_instrument->withPolarizerAnalyzer()); {
layout->addWidget(checkbox); auto* polarizerCheckbox = new QCheckBox("Enable beam polarization");
polarizerCheckbox->setChecked(m_instrument->withPolarizer());
layout->addWidget(polarizerCheckbox);
auto* polarizerAnalyzerWidget = new QWidget(this); auto* polarizerWidget = new QWidget(this);
auto* formlayout = new QFormLayout(polarizerAnalyzerWidget); auto* polarizerLayout = new QFormLayout(polarizerWidget);
formlayout->setFieldGrowthPolicy(QFormLayout::FieldsStayAtSizeHint); polarizerLayout->setFieldGrowthPolicy(QFormLayout::FieldsStayAtSizeHint);
addPolarizerRow(formlayout, m_instrument->polarizerBlochVector()); addPolarizerRow(polarizerLayout, m_instrument->polarizerBlochVector());
addPolarizerRow(formlayout, m_instrument->analyzerBlochVector());
layout->addWidget(polarizerAnalyzerWidget); layout->addWidget(polarizerWidget);
polarizerAnalyzerWidget->setVisible(m_instrument->withPolarizerAnalyzer()); polarizerWidget->setVisible(m_instrument->withPolarizer());
connect(checkbox, &QCheckBox::toggled, [this, polarizerAnalyzerWidget](bool b) { connect(polarizerCheckbox, &QCheckBox::toggled, [this, polarizerWidget](bool b) {
polarizerAnalyzerWidget->setVisible(b); polarizerWidget->setVisible(b);
m_instrument->setWithPolarizerAnalyzer(b); m_instrument->setWithPolarizer(b);
emit dataChanged(); 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); auto* collapser = GroupBoxCollapser::installIntoGroupBox(this);
collapser->setExpanded(instrument->isExpandPolarizerAlanyzer()); collapser->setExpanded(instrument->isExpandPolarizerAlanyzer());
......
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