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

var name

parent 140d9252
No related branches found
No related tags found
1 merge request!2055GUI cleanup while reading towards detector editor
......@@ -21,10 +21,10 @@
#include "GUI/View/Numeric/SafeSpinBox.h"
#include <QFormLayout>
DetectorForm::DetectorForm(QWidget* parent, DetectorItem* detector)
DetectorForm::DetectorForm(QWidget* parent, DetectorItem* detectorItem)
: QWidget(parent)
{
ASSERT(detector);
ASSERT(detectorItem);
auto* grid = new QGridLayout(this);
grid->setColumnStretch(0, 1);
......@@ -37,28 +37,28 @@ DetectorForm::DetectorForm(QWidget* parent, DetectorItem* detector)
auto* xAxisNbinsSpinBox = new SafeSpinBox;
xAxisNbinsSpinBox->setRange(1, 65536);
xAxisNbinsSpinBox->setValue(detector->xSize());
xAxisNbinsSpinBox->setValue(detectorItem->xSize());
xAxisFormLayout->addRow("# bins:", xAxisNbinsSpinBox);
auto* widthSpinBox = new DoubleSpinBox(detector->width());
auto* widthSpinBox = new DoubleSpinBox(detectorItem->width());
xAxisFormLayout->addRow("Width [mm]:", widthSpinBox);
connect(xAxisNbinsSpinBox, qOverload<int>(&QSpinBox::valueChanged),
[this, detector](int newValue) {
detector->setXSize(newValue);
[this, detectorItem](int newValue) {
detectorItem->setXSize(newValue);
emit dataChanged();
});
connect(widthSpinBox, qOverload<double>(&DoubleSpinBox::baseValueChanged),
[this, detector](double newValue) {
detector->setWidth(newValue);
[this, detectorItem](double newValue) {
detectorItem->setWidth(newValue);
emit dataChanged();
});
grid->addWidget(xAxisGroupBox, 1, 0);
auto* collapserX = GroupBoxCollapser::installIntoGroupBox(xAxisGroupBox);
collapserX->setExpanded(detector->isExpandXaxis());
collapserX->setExpanded(detectorItem->isExpandXaxis());
connect(collapserX, &GroupBoxCollapser::toggled, this,
[detector](bool b) { detector->setExpandXaxis(b); });
[detectorItem](bool b) { detectorItem->setExpandXaxis(b); });
// -- y-axis controls
......@@ -67,38 +67,38 @@ DetectorForm::DetectorForm(QWidget* parent, DetectorItem* detector)
auto* yAxisNbinsSpinBox = new SafeSpinBox;
yAxisNbinsSpinBox->setRange(1, 65536);
yAxisNbinsSpinBox->setValue(detector->ySize());
yAxisNbinsSpinBox->setValue(detectorItem->ySize());
yAxisFormLayout->addRow("# bins:", yAxisNbinsSpinBox);
auto* heightSpinBox = new DoubleSpinBox(detector->height());
auto* heightSpinBox = new DoubleSpinBox(detectorItem->height());
yAxisFormLayout->addRow("Height [mm]:", heightSpinBox);
connect(yAxisNbinsSpinBox, qOverload<int>(&QSpinBox::valueChanged),
[this, detector](int newValue) {
detector->setYSize(newValue);
[this, detectorItem](int newValue) {
detectorItem->setYSize(newValue);
emit dataChanged();
});
connect(heightSpinBox, qOverload<double>(&DoubleSpinBox::baseValueChanged),
[this, detector](double newValue) {
detector->setHeight(newValue);
[this, detectorItem](double newValue) {
detectorItem->setHeight(newValue);
emit dataChanged();
});
grid->addWidget(yAxisGroupBox, 1, 1);
auto* collapserY = GroupBoxCollapser::installIntoGroupBox(yAxisGroupBox);
collapserY->setExpanded(detector->isExpandYaxis());
collapserY->setExpanded(detectorItem->isExpandYaxis());
connect(collapserY, &GroupBoxCollapser::toggled, this,
[detector](bool b) { detector->setExpandYaxis(b); });
[detectorItem](bool b) { detectorItem->setExpandYaxis(b); });
// -- resolution function
auto* resolutionForm = new ResolutionForm(ResolutionForm::Millimeter, this, detector);
auto* resolutionForm = new ResolutionForm(ResolutionForm::Millimeter, this, detectorItem);
grid->addWidget(resolutionForm, 1, 2);
connect(resolutionForm, &ResolutionForm::dataChanged, this, &DetectorForm::dataChanged);
// alignment selector editors
auto* alignmentForm = new DetectorAlignmentForm(this, detector);
auto* alignmentForm = new DetectorAlignmentForm(this, detectorItem);
grid->addWidget(alignmentForm, 2, 0, 1, 3);
connect(alignmentForm, &DetectorAlignmentForm::dataChanged, this, &DetectorForm::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