// 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
- setDecimals(thePrecision);
+ setDecimals(qAbs(myPrecision));
connect(lineEdit(), SIGNAL(textChanged( const QString& )), this,
SLOT(onTextChanged( const QString& )));
*/
void ModuleBase_DoubleSpinBox::setPrecision(const int prec)
{
- int newPrec = qMax(prec, 0);
- int oldPrec = qMax(myPrecision, 0);
+ int newPrec = qAbs(prec);
+ int oldPrec = qAbs(myPrecision);
myPrecision = prec;
if (newPrec != oldPrec)
update();
/*!
\brief Get precision value of the spin box
- \return current prevision value
+ \return current precision value
\sa setPrecision()
*/
int ModuleBase_DoubleSpinBox::getPrecision() const
Q_OBJECT
public:
- explicit ModuleBase_DoubleSpinBox( QWidget* theParent = 0, int thePrecision = 12 );
+ explicit ModuleBase_DoubleSpinBox( QWidget* theParent = 0, int thePrecision = -12 );
virtual ~ModuleBase_DoubleSpinBox();
/// Returns true if the control is clear
enum State { Invalid = 0, NoVariable, Incompatible, Acceptable };
public:
- explicit ModuleBase_ParamSpinBox( QWidget* theParent = 0, int thePrecision = 12 );
+ explicit ModuleBase_ParamSpinBox( QWidget* theParent = 0, int thePrecision = -12 );
virtual ~ModuleBase_ParamSpinBox();
virtual void stepBy(int);