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

sort blocks

parent 5daf4adc
No related branches found
No related tags found
1 merge request!2058GUI instrument editor: detector section made more compact
......@@ -76,6 +76,7 @@ DetectorEditor::DetectorEditor(QWidget* parent, GISASInstrumentItem* instrItem)
grid->setColumnStretch(2, 1);
//... x-axis controls
auto* xAxisFormLayout = new QFormLayout;
auto* xAxisGroupBox = new GroupBox("X axis", xAxisFormLayout, this);
......@@ -99,8 +100,8 @@ DetectorEditor::DetectorEditor(QWidget* parent, GISASInstrumentItem* instrItem)
});
grid->addWidget(xAxisGroupBox, 1, 0);
//... y-axis controls
auto* yAxisFormLayout = new QFormLayout;
auto* yAxisGroupBox = new GroupBox("Y axis", yAxisFormLayout, this);
......@@ -124,21 +125,15 @@ DetectorEditor::DetectorEditor(QWidget* parent, GISASInstrumentItem* instrItem)
});
grid->addWidget(yAxisGroupBox, 1, 1);
//... detector alignment controls
auto* alignmentForm = new DetectorAlignmentForm(this, detectorItem);
grid->addWidget(alignmentForm, 2, 0, 1, 3);
connect(alignmentForm, &DetectorAlignmentForm::dataChanged, this, &DetectorEditor::dataChanged);
formLayout->addRow(grid);
//... resolution controls
auto resolutionLayout = new QFormLayout;
resolutionLayout->setFieldGrowthPolicy(QFormLayout::FieldsStayAtSizeHint);
auto* resolutionForm = new GroupBox("Resolution function", resolutionLayout, this);
auto updateResolutionForm = [parent = this, layout = resolutionLayout, item = detectorItem]() -> void {
auto updateResolutionForm = [parent = this, layout = resolutionLayout,
item = detectorItem]() -> void {
while (layout->rowCount() > 1)
layout->removeRow(1);
......@@ -161,14 +156,23 @@ DetectorEditor::DetectorEditor(QWidget* parent, GISASInstrumentItem* instrItem)
}
};
auto* typeCombo = GUI::Util::createComboBoxFromProperty(detectorItem->resolutionFunctionSelection(),
[this, updateResolutionForm](int) {
updateResolutionForm();
emit dataChanged();
});
auto* typeCombo = GUI::Util::createComboBoxFromProperty(
detectorItem->resolutionFunctionSelection(), [this, updateResolutionForm](int) {
updateResolutionForm();
emit dataChanged();
});
resolutionLayout->addRow("Type:", typeCombo);
updateResolutionForm();
grid->addWidget(resolutionForm, 1, 2);
//... detector alignment controls
auto* alignmentForm = new DetectorAlignmentForm(this, detectorItem);
grid->addWidget(alignmentForm, 2, 0, 1, 3);
connect(alignmentForm, &DetectorAlignmentForm::dataChanged, this, &DetectorEditor::dataChanged);
formLayout->addRow(grid);
}
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