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;
void resetSteppedTo()
Resets the ::steppedTo flag after the value has been changed.
Definition: sispinbox.cpp:184
void stepBy(int steps) override
Increase/decrease the values in fixed steps.
Definition: sispinbox.cpp:89
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
QString unitPostfix
Shown after the unit.
Definition: sispinbox.h:37
QString textFromValue(double val) const override
Get string representation of value.
Definition: sispinbox.cpp:75
void setBackground()
Definition: sispinbox.cpp:187
void setMode(const int mode)
Set the mode.
Definition: sispinbox.cpp:164
void init()
Generic initializations.
Definition: sispinbox.cpp:167
void setUnitPostfix(const QString &postfix)
Set the unit postfix for this spin box.
Definition: sispinbox.cpp:154
SiSpinBox(QWidget *parent=nullptr)
Initializes the SiSpinBox internals.
Definition: sispinbox.cpp:35
int stepId
The index of the last step reached using stepBy.
Definition: sispinbox.h:42
~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
A spin box with SI prefix support. This spin box supports the SI prefixes (k/M/G/T) after its value a...
Definition: sispinbox.h:14
Unit
The various units supported by valueToString.
Definition: printutils.h:12
int mode
The mode, fixed or constant.
Definition: sispinbox.h:39
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
QList< double > steps
The steps, begins from start after last element.
Definition: sispinbox.h:38
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