22 #include <QFormLayout>
23 #include <QGridLayout>
26 #include <QVBoxLayout>
34 auto* grid =
new QGridLayout(
this);
35 grid->setColumnStretch(0, 1);
36 grid->setColumnStretch(1, 1);
37 grid->setColumnStretch(2, 1);
40 auto* xAxisGroupBox =
new QGroupBox(
"X axis",
this);
41 xAxisGroupBox->setProperty(
"subgroup",
true);
42 auto* xAxisFormLayout =
new QFormLayout(xAxisGroupBox);
44 auto* xAxisNbinsSpinBox =
new QSpinBox(xAxisGroupBox);
45 xAxisNbinsSpinBox->setRange(1, 65536);
46 xAxisNbinsSpinBox->setValue(detector->
xSize());
47 xAxisFormLayout->addRow(
"Nbins:", xAxisNbinsSpinBox);
49 auto* widthSpinBox =
new DoubleSpinBox(xAxisGroupBox, detector->width());
50 xAxisFormLayout->addRow(
"Width [mm]:", widthSpinBox);
52 connect(xAxisNbinsSpinBox, qOverload<int>(&QSpinBox::valueChanged), [=](
int newValue) {
58 [=](
double newValue) {
59 detector->setWidth(newValue);
62 grid->addWidget(xAxisGroupBox, 1, 0);
67 auto* yAxisGroupBox =
new QGroupBox(
"Y axis",
this);
68 yAxisGroupBox->setProperty(
"subgroup",
true);
69 auto* yAxisFormLayout =
new QFormLayout(yAxisGroupBox);
71 auto* yAxisNbinsSpinBox =
new QSpinBox(yAxisGroupBox);
72 yAxisNbinsSpinBox->setRange(1, 65536);
73 yAxisNbinsSpinBox->setValue(detector->
ySize());
74 yAxisFormLayout->addRow(
"Nbins:", yAxisNbinsSpinBox);
76 auto* heightSpinBox =
new DoubleSpinBox(yAxisGroupBox, detector->height());
77 yAxisFormLayout->addRow(
"Height [mm]:", heightSpinBox);
79 connect(yAxisNbinsSpinBox, qOverload<int>(&QSpinBox::valueChanged), [=](
int newValue) {
85 [=](
double newValue) {
86 detector->setHeight(newValue);
89 grid->addWidget(yAxisGroupBox, 1, 1);
93 auto* resolutionFunctionEditor =
95 grid->addWidget(resolutionFunctionEditor, 1, 2);
102 grid->addWidget(alignmentEditor, 2, 0, 1, 3);
Defines various axis items.
A widget for editing the alignment of a detector.
Defines class DoubleSpinBox.
Defines class GroupBoxCollapser.
Defines class RectangularDetectorEditor.
Defines class RectangularDetectorItem.
A widget for editing the alignment of a detector.
Widget for selecting the alignment of a detector (combo box) and input of the corresponding values.
SpinBox for DoubleDescriptors, supporting units.
void baseValueChanged(double newBaseValue)
Emitted whenever the value changes.
static GroupBoxCollapser * installIntoGroupBox(QGroupBox *groupBox, bool expanded=true)
RectangularDetectorEditor(QWidget *parent, RectangularDetectorItem *item)
int ySize() const override
Returns the size of y-axis of the detector.
void setXSize(size_t nx) override
sets the size of x-axis of the detector
void setYSize(size_t ny) override
sets the size of y-axis of the detector
int xSize() const override
Returns the size of x-axis of the detector.
Widget for selecting the resolution function of a detector (combo box) and input of the corresponding...