Skip to content
Snippets Groups Projects
Commit c1a96adb authored by Wuttke, Joachim's avatar Wuttke, Joachim
Browse files

ScanEditor: GridLayout to prepare for more fields

parent 177a0e01
No related branches found
No related tags found
1 merge request!2668ScanEditor: grid layout to prepare for unit switch
......@@ -31,12 +31,12 @@ ScanEditor::ScanEditor(QWidget* parent, InstrumentItem* instr_item, ScanItem* it
bool allow_footprint, bool allow_distr)
: CollapsibleGroupBox("Beam and scan parameters", parent, item->expandBeamParameters)
{
auto* layout = new QVBoxLayout(body());
auto* layout = new QGridLayout(body());
//... Intensity
auto* form = new QFormLayout;
layout->addLayout(form);
layout->addLayout(form, 0, 0);
form->setFieldGrowthPolicy(QFormLayout::FieldsStayAtSizeHint);
auto* intensity_spinbox = new DSpinBox(&item->intensity());
form->addRow("Intensity:", intensity_spinbox);
......@@ -44,17 +44,13 @@ ScanEditor::ScanEditor(QWidget* parent, InstrumentItem* instr_item, ScanItem* it
//... Wavelength and angles of incidence
auto* hLayout = new QHBoxLayout;
hLayout->setAlignment(Qt::AlignLeft);
layout->addLayout(hLayout);
auto* wavelengthEditor = new DistributionEditor("Wavelength (nm)", MeanConfig{true},
DistributionSelector::Category::Symmetric, this,
item->wavelengthItem(), allow_distr);
hLayout->addWidget(wavelengthEditor);
layout->addWidget(wavelengthEditor, 1, 0);
auto* inclinationEditor = new AlphaScanEditor(this, item->grazingScanItem(), allow_distr);
hLayout->addWidget(inclinationEditor);
layout->addWidget(inclinationEditor, 1, 1);
// In the following, signal order is important! Indicators have to be recalculated first,
// then updated (recalculation is done in EditController)
......@@ -82,7 +78,7 @@ ScanEditor::ScanEditor(QWidget* parent, InstrumentItem* instr_item, ScanItem* it
if (allow_footprint) {
auto* footprintEditor = new FootprintForm(this, item);
hLayout->addWidget(footprintEditor);
layout->addWidget(footprintEditor, 1, 2);
connect(footprintEditor, &FootprintForm::dataChanged, this, &ScanEditor::dataChanged);
}
}
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