From: spo Date: Thu, 10 Sep 2015 07:52:59 +0000 (+0300) Subject: Issue #910 - Impossible to set start point , end points for line manually X-Git-Tag: V_1.4.0_beta4~45 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=7df901531d6c7df50b82058bece27151629c9298;p=modules%2Fshaper.git Issue #910 - Impossible to set start point , end points for line manually --- diff --git a/src/ModuleBase/ModuleBase_DoubleSpinBox.cpp b/src/ModuleBase/ModuleBase_DoubleSpinBox.cpp index 59d5c0285..e11fbd732 100644 --- a/src/ModuleBase/ModuleBase_DoubleSpinBox.cpp +++ b/src/ModuleBase/ModuleBase_DoubleSpinBox.cpp @@ -71,7 +71,7 @@ ModuleBase_DoubleSpinBox::ModuleBase_DoubleSpinBox(QWidget* theParent, int thePr // 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& ))); @@ -119,8 +119,8 @@ void ModuleBase_DoubleSpinBox::setCleared(const bool on) */ 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(); @@ -128,7 +128,7 @@ void ModuleBase_DoubleSpinBox::setPrecision(const int prec) /*! \brief Get precision value of the spin box - \return current prevision value + \return current precision value \sa setPrecision() */ int ModuleBase_DoubleSpinBox::getPrecision() const diff --git a/src/ModuleBase/ModuleBase_DoubleSpinBox.h b/src/ModuleBase/ModuleBase_DoubleSpinBox.h index 2daa53b95..87cbe6e84 100644 --- a/src/ModuleBase/ModuleBase_DoubleSpinBox.h +++ b/src/ModuleBase/ModuleBase_DoubleSpinBox.h @@ -21,7 +21,7 @@ class MODULEBASE_EXPORT ModuleBase_DoubleSpinBox : public QDoubleSpinBox 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 diff --git a/src/ModuleBase/ModuleBase_ParamSpinBox.h b/src/ModuleBase/ModuleBase_ParamSpinBox.h index 89e99ff7c..7d14e9511 100644 --- a/src/ModuleBase/ModuleBase_ParamSpinBox.h +++ b/src/ModuleBase/ModuleBase_ParamSpinBox.h @@ -15,7 +15,7 @@ class MODULEBASE_EXPORT ModuleBase_ParamSpinBox : public ModuleBase_DoubleSpinBo 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);