20 #include <QFormLayout>
26 : QGroupBox(groupTitle, parent)
27 , m_axisProperty(axisProperty)
29 setProperty(
"subgroup",
true);
30 auto* formLayout =
new QFormLayout(
this);
31 formLayout->setFieldGrowthPolicy(QFormLayout::FieldsStayAtSizeHint);
39 connect(
m_nbinsSpinBox, qOverload<int>(&QSpinBox::valueChanged), [=](
int v) {
40 if (axisProperty->nbins() !=
static_cast<uint
>(v)) {
41 axisProperty->setNbins(v);
48 m_axisProperty->setMin(v);
50 if (m_axisProperty->max() < v) {
51 m_axisProperty->setMax(v);
52 m_maxSpinBox->updateValue();
58 if (m_axisProperty->max() != v) {
59 m_axisProperty->setMax(v);
61 if (m_axisProperty->min() > v) {
62 m_axisProperty->setMin(v);
63 m_minSpinBox->updateValue();
Defines class AxisPropertyEditor.
Defines class AxisProperty.
Defines class DoubleSpinBox.
Defines class GroupBoxCollapser.
AxisPropertyEditor(QWidget *parent, const QString &groupTitle, AxisProperty *axisProperty)
DoubleSpinBox * m_minSpinBox
void updateData()
Reload UI from data.
DoubleSpinBox * m_maxSpinBox
QSpinBox * m_nbinsSpinBox
AxisProperty * m_axisProperty
Holds values which can be used to describe a FixedBinAxis.
void updateValue()
Update the shown value to the one contained in the value descriptor.
void baseValueChanged(double newBaseValue)
Emitted whenever the value changes.
static GroupBoxCollapser * installIntoGroupBox(QGroupBox *groupBox, bool expanded=true)
QSpinBox * createSpinBox(QWidget *parent, const UIntDescriptor &d, std::function< void(uint)> slot=nullptr)
Create a spin box with the information found in a UIntDescriptor.