15 #ifndef BORNAGAIN_GUI_VIEW_COMMON_DOUBLESPINBOX_H
16 #define BORNAGAIN_GUI_VIEW_COMMON_DOUBLESPINBOX_H
19 #include <QDoubleSpinBox>
74 using QDoubleSpinBox::setValue;
Defines class DoubleDescriptor.
Unit
Defines units, mainly to be able to convert between units.
Describes properties of a double value which are necessary to allow GUI representation,...
SpinBox for DoubleDescriptors, supporting units.
Unit baseUnit() const
Returns the unit of the contained DoubleDescriptor.
DoubleDescriptor m_valueDescriptor
double toBaseValue(double displayValue) const
void updateValue()
Update the shown value to the one contained in the value descriptor.
void wheelEvent(QWheelEvent *event) override
const DoubleDescriptor & valueDescriptor() const
The descriptor on which this spinbox operates.
void setDisplayUnit(Unit displayUnit)
Set a display unit.
void setBaseValue(double baseValue)
Set the base value (unit is the one of the contained descriptor).
bool m_showUnitAsSuffix
it was decided to not show the unit as a suffix. However, this may be user selectable once,...
DoubleSpinBox(QWidget *parent, const DoubleDescriptor &d)
Create a DoubleSpinBox with the information found in a DoubleDescriptor.
QString displayUnitAsString() const
The display unit as human readable string.
void baseValueChanged(double newBaseValue)
Emitted whenever the value changes.
void onDisplayValueChanged(double newDisplayValue)
double toDisplayValue(double baseValue) const