through a constructor or using setPrecision() method.
Note that "decimals" property of QDoubleSpinBox is almost completely substituted
through a constructor or using setPrecision() method.
Note that "decimals" property of QDoubleSpinBox is almost completely substituted
-ModuleBase_DoubleSpinBox::ModuleBase_DoubleSpinBox(QWidget* parent, int thePrecision)
- : QDoubleSpinBox(parent),
+ModuleBase_DoubleSpinBox::ModuleBase_DoubleSpinBox(QWidget* theParent, int thePrecision)
+ : QDoubleSpinBox(theParent),
// Use precision equal to default Qt decimals
// it's necessary to set decimals before the range setting,
// by default Qt rounds boundaries to 2 decimals at setRange
// Use precision equal to default Qt decimals
// it's necessary to set decimals before the range setting,
// by default Qt rounds boundaries to 2 decimals at setRange
connect(lineEdit(), SIGNAL(textChanged( const QString& )), this,
SLOT(onTextChanged( const QString& )));
connect(lineEdit(), SIGNAL(textChanged( const QString& )), this,
SLOT(onTextChanged( const QString& )));
- int newPrec = qMax(prec, 0);
- int oldPrec = qMax(myPrecision, 0);
+ int newPrec = qAbs(prec);
+ int oldPrec = qAbs(myPrecision);
// Otherwise, expect myPrecision digits after the decimal point.
int decs = myPrecision < 0 ? qAbs(myPrecision) - 1 : myPrecision;
// Otherwise, expect myPrecision digits after the decimal point.
int decs = myPrecision < 0 ? qAbs(myPrecision) - 1 : myPrecision;
// This check is enabled by assigning "strict_validity_check" dynamic property
// with value "true" to the spin box instance.
if (state == QValidator::Intermediate) {
// This check is enabled by assigning "strict_validity_check" dynamic property
// with value "true" to the spin box instance.
if (state == QValidator::Intermediate) {