21 #include <QFormLayout>
25 : QGroupBox(
"Polarization analysis", parent)
26 , m_instrument(instrument)
30 auto* layout =
new QVBoxLayout(
this);
32 auto* checkbox =
new QCheckBox(QString(
"Enable %1").arg(title()));
34 layout->addWidget(checkbox);
36 auto* polarizerAnalyzerWidget =
new QWidget(
this);
37 auto* formlayout =
new QFormLayout(polarizerAnalyzerWidget);
38 formlayout->setFieldGrowthPolicy(QFormLayout::FieldsStayAtSizeHint);
48 layout->addWidget(polarizerAnalyzerWidget);
51 connect(checkbox, &QCheckBox::toggled, [=](
bool b) {
52 polarizerAnalyzerWidget->setVisible(b);
74 auto* layout =
new QHBoxLayout;
78 layout->addWidget(
createSpinBox(parentLayout->parentWidget(), d));
85 layout->addItem(
new QSpacerItem(0, 0, QSizePolicy::Expanding));
87 parentLayout->addRow(d.
label +
":", layout);
Defines class DoubleSpinBox.
Defines class GroupBoxCollapser.
Defines class InstrumentItem and all its children.
Defines class PolarizationAnalysisEditor.
Describes properties of a double value which are necessary to allow GUI representation,...
function< double()> get
function to get the current value
SpinBox for DoubleDescriptors, supporting units.
void baseValueChanged(double newBaseValue)
Emitted whenever the value changes.
static GroupBoxCollapser * installIntoGroupBox(QGroupBox *groupBox, bool expanded=true)
Abstract base class for instrument-specific item classes.
bool withPolarizerAnalyzer() const
void setWithPolarizerAnalyzer(bool with)
DoubleSpinBox * createSpinBox(QWidget *parent, const DoubleDescriptor &d)
void addVector(QFormLayout *parentLayout, const VectorDescriptor &d)
PolarizationAnalysisEditor(QWidget *parent, InstrumentItem *instrument)
InstrumentItem * m_instrument
Describes properties of a 3D vector, consisting of three double values.
QString label
A label text (short, no trailing colon)
QString labelWithUnit(const QString &label, std::variant< QString, Unit > unit)
Create a label with an optional unit in brackets.