From 88e7ede2a62915b3352857c25e4f0bf683f3dc27 Mon Sep 17 00:00:00 2001 From: san Date: Mon, 26 Apr 2010 12:55:38 +0000 Subject: [PATCH] Issue 0020580: It is important for spinboxes used in GUI_SRC to set default precision = 2 (default QDoubleSpinBox decimals) in QtxDoubleSpinBox to avoid regressions --- src/Qtx/QtxDoubleSpinBox.cxx | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) 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 ); -- 2.39.2