5 #include <QDoubleSpinBox> 18 explicit SiSpinBox(QWidget *parent =
nullptr);
22 QValidator::State
validate(QString &input,
int &pos)
const;
25 void fixup(QString &input)
const;
void resetSteppedTo()
Resets the ::steppedTo flag after the value has been changed.
Definition: sispinbox.cpp:181
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
void fixup(QString &input) const
Fixes the text after the user finished changing it.
Definition: sispinbox.cpp:79
void setBackground()
Definition: sispinbox.cpp:184
void setMode(const int mode)
Set the mode.
Definition: sispinbox.cpp:161
void init()
Generic initializations.
Definition: sispinbox.cpp:164
void setUnitPostfix(const QString &postfix)
Set the unit postfix for this spin box.
Definition: sispinbox.cpp:151
SiSpinBox(QWidget *parent=nullptr)
Initializes the SiSpinBox internals.
Definition: sispinbox.cpp:35
double valueFromText(const QString &text) const
Parse value from input text.
Definition: sispinbox.cpp:70
int stepId
The index of the last step reached using stepBy.
Definition: sispinbox.h:42
void stepBy(int steps)
Increase/decrease the values in fixed steps.
Definition: sispinbox.cpp:90
QList< double > steps
The steps, begins from start after last element.
Definition: sispinbox.h:38
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:156
QString textFromValue(double val) const
Get string representation of value.
Definition: sispinbox.cpp:75
QValidator::State validate(QString &input, int &pos) const
Validates the text after user input.
Definition: sispinbox.cpp:55
bool setUnit(Unit unit)
Set the unit for this spin box.
Definition: sispinbox.cpp:142
~SiSpinBox()
Cleans up the main window.
Definition: sispinbox.cpp:49