5#include <QDoubleSpinBox>
18 explicit SiSpinBox( QWidget *parent =
nullptr );
22 QValidator::State
validate( QString &input,
int &pos )
const override;
25 void fixup( QString &input )
const override;
double valueFromText(const QString &text) const override
Parse value from input text.
Definition sispinbox.cpp:70
bool setUnit(Unit unit)
Set the unit for this spin box.
Definition sispinbox.cpp:144
void fixup(QString &input) const override
Fixes the text after the user finished changing it.
Definition sispinbox.cpp:79
bool steppedTo
true, if the current value was reached using stepBy
Definition sispinbox.h:41
void setSteps(const QList< double > &steps)
Set the steps the spin box will take.
Definition sispinbox.cpp:159
QValidator::State validate(QString &input, int &pos) const override
Validates the text after user input.
Definition sispinbox.cpp:53
QString textFromValue(double val) const override
Get string representation of value.
Definition sispinbox.cpp:75
void resetSteppedTo()
Resets the steppedTo flag after the value has been changed.
Definition sispinbox.cpp:184
void init()
Generic initializations.
Definition sispinbox.cpp:167
void stepBy(int steps) override
Increase/decrease the values in fixed steps.
Definition sispinbox.cpp:89
int stepId
The index of the last step reached using stepBy.
Definition sispinbox.h:42
int mode
The mode, fixed or constant.
Definition sispinbox.h:39
void setUnitPostfix(const QString &postfix)
Set the unit postfix for this spin box.
Definition sispinbox.cpp:154
QList< double > steps
The steps, begins from start after last element.
Definition sispinbox.h:38
~SiSpinBox() override
Cleans up the main window.
Definition sispinbox.cpp:47
Unit unit
The SI unit used for this spin box.
Definition sispinbox.h:36
void setBackground()
Definition sispinbox.cpp:187
QString unitPostfix
Shown after the unit.
Definition sispinbox.h:37
void setMode(const int mode)
Set the mode.
Definition sispinbox.cpp:164
SiSpinBox(QWidget *parent=nullptr)
Initializes the SiSpinBox internals.
Definition sispinbox.cpp:35
Unit
The various units supported by valueToString.
Definition printutils.h:12