|
static double | round (double val, int decimals) |
|
static double | toDouble (QString text, const QDoubleValidator &validator, double min, double max, double default_value) |
|
static QString | toString (double val, int decimal_points) |
|
|
QAbstractSpinBox::StepEnabled | stepEnabled () const override |
|
Definition at line 23 of file scientificspinbox.h.
◆ ScientificSpinBox()
ScientificSpinBox::ScientificSpinBox |
( |
QWidget * |
parent = nullptr | ) |
|
Definition at line 32 of file scientificspinbox.cpp.
33 : QAbstractSpinBox(parent)
41 locale.setNumberOptions(QLocale::RejectGroupSeparator);
43 m_validator.setNotation(QDoubleValidator::ScientificNotation);
QDoubleValidator m_validator
const int default_double_decimals
References m_validator, and updateValue().
◆ ~ScientificSpinBox()
ScientificSpinBox::~ScientificSpinBox |
( |
| ) |
|
|
overridedefault |
◆ decimals()
int ScientificSpinBox::decimals |
( |
| ) |
const |
◆ fixup()
void ModelView::ScientificSpinBox::fixup |
( |
QString & |
| ) |
const |
|
inlineoverride |
◆ inRange()
bool ScientificSpinBox::inRange |
( |
double |
val | ) |
const |
|
private |
◆ maximum()
double ScientificSpinBox::maximum |
( |
| ) |
const |
◆ minimum()
double ScientificSpinBox::minimum |
( |
| ) |
const |
◆ round()
double ScientificSpinBox::round |
( |
double |
val, |
|
|
int |
decimals |
|
) |
| |
|
static |
◆ setDecimals()
void ScientificSpinBox::setDecimals |
( |
int |
val | ) |
|
◆ setMaximum()
void ScientificSpinBox::setMaximum |
( |
double |
max | ) |
|
◆ setMinimum()
void ScientificSpinBox::setMinimum |
( |
double |
min | ) |
|
◆ setSingleStep()
void ScientificSpinBox::setSingleStep |
( |
double |
step | ) |
|
◆ setValue()
void ScientificSpinBox::setValue |
( |
double |
val | ) |
|
Definition at line 57 of file scientificspinbox.cpp.
62 if (std::abs(old_val -
m_value) > min_val)
static double round(double val, int decimals)
void valueChanged(double value)
References m_decimals, m_value, round(), updateText(), and valueChanged().
Referenced by setDecimals(), setMaximum(), setMinimum(), stepBy(), ModelView::ScientificSpinBoxEditor::update_components(), and updateValue().
◆ singleStep()
double ScientificSpinBox::singleStep |
( |
| ) |
const |
◆ stepBy()
void ScientificSpinBox::stepBy |
( |
int |
steps | ) |
|
|
override |
◆ stepEnabled()
QAbstractSpinBox::StepEnabled ScientificSpinBox::stepEnabled |
( |
| ) |
const |
|
overrideprotected |
Definition at line 153 of file scientificspinbox.cpp.
155 return isReadOnly() ? StepNone : StepUpEnabled | StepDownEnabled;
◆ toDouble()
double ScientificSpinBox::toDouble |
( |
QString |
text, |
|
|
const QDoubleValidator & |
validator, |
|
|
double |
min, |
|
|
double |
max, |
|
|
double |
default_value |
|
) |
| |
|
static |
Definition at line 134 of file scientificspinbox.cpp.
138 if (validator.validate(text, pos) == QValidator::Acceptable) {
139 double new_val = validator.locale().toDouble(text);
140 if (std::abs(new_val) < min_val)
142 return new_val >= min && new_val <= max ? new_val : default_value;
144 return default_value;
Referenced by TEST_F(), updateValue(), and value().
◆ toString()
QString ScientificSpinBox::toString |
( |
double |
val, |
|
|
int |
decimal_points |
|
) |
| |
|
static |
◆ updateText()
void ScientificSpinBox::updateText |
( |
| ) |
|
|
private |
◆ updateValue()
void ScientificSpinBox::updateValue |
( |
| ) |
|
|
private |
◆ validate()
QValidator::State ModelView::ScientificSpinBox::validate |
( |
QString & |
, |
|
|
int & |
|
|
) |
| const |
|
inlineoverride |
◆ value()
double ScientificSpinBox::value |
( |
| ) |
const |
◆ valueChanged
void ModelView::ScientificSpinBox::valueChanged |
( |
double |
value | ) |
|
|
signal |
◆ m_decimals
int ModelView::ScientificSpinBox::m_decimals |
|
private |
◆ m_max
double ModelView::ScientificSpinBox::m_max |
|
private |
◆ m_min
double ModelView::ScientificSpinBox::m_min |
|
private |
◆ m_step
double ModelView::ScientificSpinBox::m_step |
|
private |
◆ m_validator
QDoubleValidator ModelView::ScientificSpinBox::m_validator |
|
private |
◆ m_value
double ModelView::ScientificSpinBox::m_value |
|
private |
◆ value
double ModelView::ScientificSpinBox::value |
|
readwrite |
The documentation for this class was generated from the following files: