BornAgain  1.19.79
Simulate and fit neutron and x-ray scattering at grazing incidence
RectangularDetectorEditor Class Reference

Description

Definition at line 22 of file RectangularDetectorEditor.h.

Inheritance diagram for RectangularDetectorEditor:
[legend]
Collaboration diagram for RectangularDetectorEditor:
[legend]

Signals

void dataChanged ()
 

Public Member Functions

 RectangularDetectorEditor (QWidget *parent, RectangularDetectorItem *item)
 

Constructor & Destructor Documentation

◆ RectangularDetectorEditor()

RectangularDetectorEditor::RectangularDetectorEditor ( QWidget *  parent,
RectangularDetectorItem item 
)

Definition at line 28 of file RectangularDetectorEditor.cpp.

30  : QWidget(parent)
31 {
32  ASSERT(detector);
33 
34  auto* grid = new QGridLayout(this);
35  grid->setColumnStretch(0, 1);
36  grid->setColumnStretch(1, 1);
37  grid->setColumnStretch(2, 1);
38 
39  // -- x-axis controls
40  auto* xAxisGroupBox = new QGroupBox("X axis", this);
41  xAxisGroupBox->setProperty("subgroup", true); // for stylesheet addressing
42  auto* xAxisFormLayout = new QFormLayout(xAxisGroupBox);
43 
44  auto* xAxisNbinsSpinBox = new QSpinBox(xAxisGroupBox);
45  xAxisNbinsSpinBox->setRange(1, 65536);
46  xAxisNbinsSpinBox->setValue(detector->xSize());
47  xAxisFormLayout->addRow("Nbins:", xAxisNbinsSpinBox);
48 
49  auto* widthSpinBox = new DoubleSpinBox(xAxisGroupBox, detector->width());
50  xAxisFormLayout->addRow("Width [mm]:", widthSpinBox);
51 
52  connect(xAxisNbinsSpinBox, qOverload<int>(&QSpinBox::valueChanged), [=](int newValue) {
53  detector->setXSize(newValue);
54  emit dataChanged();
55  });
56 
57  connect(widthSpinBox, qOverload<double>(&DoubleSpinBox::baseValueChanged),
58  [=](double newValue) {
59  detector->setWidth(newValue);
60  emit dataChanged();
61  });
62  grid->addWidget(xAxisGroupBox, 1, 0);
64 
65 
66  // -- y-axis controls
67  auto* yAxisGroupBox = new QGroupBox("Y axis", this);
68  yAxisGroupBox->setProperty("subgroup", true); // for stylesheet addressing
69  auto* yAxisFormLayout = new QFormLayout(yAxisGroupBox);
70 
71  auto* yAxisNbinsSpinBox = new QSpinBox(yAxisGroupBox);
72  yAxisNbinsSpinBox->setRange(1, 65536);
73  yAxisNbinsSpinBox->setValue(detector->ySize());
74  yAxisFormLayout->addRow("Nbins:", yAxisNbinsSpinBox);
75 
76  auto* heightSpinBox = new DoubleSpinBox(yAxisGroupBox, detector->height());
77  yAxisFormLayout->addRow("Height [mm]:", heightSpinBox);
78 
79  connect(yAxisNbinsSpinBox, qOverload<int>(&QSpinBox::valueChanged), [=](int newValue) {
80  detector->setYSize(newValue);
81  emit dataChanged();
82  });
83 
84  connect(heightSpinBox, qOverload<double>(&DoubleSpinBox::baseValueChanged),
85  [=](double newValue) {
86  detector->setHeight(newValue);
87  emit dataChanged();
88  });
89  grid->addWidget(yAxisGroupBox, 1, 1);
91 
92  // -- resolution function
93  auto* resolutionFunctionEditor =
95  grid->addWidget(resolutionFunctionEditor, 1, 2);
96 
97  connect(resolutionFunctionEditor, &ResolutionFunctionEditor::dataChanged, this,
99 
100  // alignment selector editors
101  auto* alignmentEditor = new DetectorAlignmentEditor(this, detector);
102  grid->addWidget(alignmentEditor, 2, 0, 1, 3);
103 
104  connect(alignmentEditor, &DetectorAlignmentEditor::dataChanged, this,
106 }
Widget for selecting the alignment of a detector (combo box) and input of the corresponding values.
SpinBox for DoubleDescriptors, supporting units.
Definition: DoubleSpinBox.h:22
void baseValueChanged(double newBaseValue)
Emitted whenever the value changes.
static GroupBoxCollapser * installIntoGroupBox(QGroupBox *groupBox, bool expanded=true)
Widget for selecting the resolution function of a detector (combo box) and input of the corresponding...

References DoubleSpinBox::baseValueChanged(), DetectorAlignmentEditor::dataChanged(), dataChanged(), ResolutionFunctionEditor::dataChanged(), GroupBoxCollapser::installIntoGroupBox(), ResolutionFunctionEditor::Millimeter, RectangularDetectorItem::setXSize(), RectangularDetectorItem::setYSize(), RectangularDetectorItem::xSize(), and RectangularDetectorItem::ySize().

Here is the call graph for this function:

Member Function Documentation

◆ dataChanged

void RectangularDetectorEditor::dataChanged ( )
signal

The documentation for this class was generated from the following files: