From: san Date: Mon, 26 Apr 2010 12:55:38 +0000 (+0000) Subject: Issue 0020580: It is important for spinboxes used in GUI_SRC to set default precision... X-Git-Tag: V5_1_4rc1~16 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=88e7ede2a62915b3352857c25e4f0bf683f3dc27;p=modules%2Fgui.git Issue 0020580: It is important for spinboxes used in GUI_SRC to set default precision = 2 (default QDoubleSpinBox decimals) in QtxDoubleSpinBox to avoid regressions --- diff --git a/src/Qtx/QtxDoubleSpinBox.cxx b/src/Qtx/QtxDoubleSpinBox.cxx index d2084cc99..f0560db9b 100644 --- a/src/Qtx/QtxDoubleSpinBox.cxx +++ b/src/Qtx/QtxDoubleSpinBox.cxx @@ -71,9 +71,11 @@ */ QtxDoubleSpinBox::QtxDoubleSpinBox( QWidget* parent ) : QDoubleSpinBox( parent ), - myCleared( false ), - myPrecision(0) + myCleared( false ) { + // Use precision equal to default Qt decimals + myPrecision = decimals(); + connect( lineEdit(), SIGNAL( textChanged( const QString& ) ), this, SLOT( onTextChanged( const QString& ) ) ); } @@ -92,9 +94,11 @@ QtxDoubleSpinBox::QtxDoubleSpinBox( QWidget* parent ) */ QtxDoubleSpinBox::QtxDoubleSpinBox( double min, double max, double step, QWidget* parent ) : QDoubleSpinBox( parent ), - myCleared( false ), - myPrecision( 0 ) + myCleared( false ) { + // Use precision equal to default Qt decimals + myPrecision = decimals(); + setMinimum( min ); setMaximum( max ); setSingleStep( step );