32#include "doubleSpinBox.h"
35#include <QDoubleSpinBox>
52 typedef QDoubleSpinBox Superclass;
59 virtual void stepBy(
int steps);
65 virtual double valueFromText(
const QString &text)
const;
66 virtual QString textFromValue(
double value)
const;
67 virtual int decimalsFromText(
const QString &text)
const;
68 virtual QValidator::State validate(QString& input,
int& pos)
const;
75 void focusOutEvent(QFocusEvent * event);
83 bool InvertedControls;
102 DoubleSpinBox::DecimalsOptions DOption;
103 bool InvertedControls;
104 DoubleSpinBox::SizeHintPolicy SizeHintPolicy;
107 double InputRange[2];
109 mutable QString CachedText;
110 mutable double CachedValue;
111 mutable QValidator::State CachedState;
112 mutable int CachedDecimals;
113 mutable QSize CachedSizeHint;
114 mutable QSize CachedMinimumSizeHint;
115 bool ForceInputValueUpdate;
117 QPointer<ValueProxy> Proxy;
121 bool compare(
double x1,
double x2)
const;
123 double round(
double value,
int decimals)
const;
126 QString
stripped(
const QString& text,
int* pos)
const;
141 void setValue(
double value,
int dec = -1);
147 QValidator::State &state,
int &decimals)
const;
149 void connectSpinBoxValueChanged();
150 void disconnectSpinBoxValueChanged();
153 void editorTextChanged(
const QString& text);
154 void onValueChanged();
156 void onValueProxyAboutToBeModified();
157 void onValueProxyModified();
Custom SpinBox The DoubleSpinBox internally uses a QDoubleSpinBox while it retain controls over it.
Definition doubleSpinBox.h:55
SetMode
Definition doubleSpinBox.h:113
Definition doubleSpinBox_p.h:91
void setValue(double value, int dec=-1)
Definition doubleSpinBox.cpp:302
int decimalsForValue(double value) const
Definition doubleSpinBox.cpp:291
int boundDecimals(int decimals) const
Definition doubleSpinBox.cpp:276
QString stripped(const QString &text, int *pos) const
Remove prefix and suffix.
Definition doubleSpinBox.cpp:254
bool compare(double x1, double x2) const
Compare two double previously rounded according to the number of decimals.
Definition doubleSpinBox.cpp:241
double validateAndInterpret(QString &input, int &pos, QValidator::State &state, int &decimals) const
Definition doubleSpinBox.cpp:376
void setDecimals(int dec)
Definition doubleSpinBox.cpp:339
double round(double value, int decimals) const
Return a value rounded with the number of decimals.
Definition doubleSpinBox.cpp:248
Base class for value proxies. Value proxy allows to decouple the displayed value from the values acce...
Definition valueProxy.h:46
Definition doubleSpinBox_p.h:43
bool invertedControls
Definition doubleSpinBox_p.h:50
void initStyleOptionSpinBox(QStyleOptionSpinBox *option)
Expose publicly QAbstractSpinBox::initStyleOption()
Definition doubleSpinBox.cpp:66
virtual StepEnabled stepEnabled() const
Definition doubleSpinBox.cpp:102
virtual QLineEdit * lineEdit() const
Definition doubleSpinBox.cpp:61
virtual void stepBy(int steps)
Definition doubleSpinBox.cpp:84