From: asl Date: Fri, 10 Jun 2005 05:37:30 +0000 (+0000) Subject: IPAL9146 X-Git-Tag: T3_0_0_a3~14 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=f321c9a05338e1c10aad2439a76ee7dda4fdeece;p=modules%2Fgui.git IPAL9146 --- diff --git a/src/Qtx/QtxDblSpinBox.cxx b/src/Qtx/QtxDblSpinBox.cxx index 0d7b22ff4..430901771 100755 --- a/src/Qtx/QtxDblSpinBox.cxx +++ b/src/Qtx/QtxDblSpinBox.cxx @@ -82,6 +82,8 @@ myPrecision( 0 ) setValidator( new Validator( this, "double_spinbox_validator" ) ); rangeChange(); updateDisplay(); + + connect( editor(), SIGNAL( textChanged( const QString& ) ), this, SLOT( onTextChanged( const QString& ) ) ); } QtxDblSpinBox::QtxDblSpinBox( double min, double max, double step, QWidget* parent, const char* name ) @@ -97,6 +99,8 @@ myPrecision( 0 ) setValidator( new Validator( this, "double_spinbox_validator" ) ); rangeChange(); updateDisplay(); + + connect( editor(), SIGNAL( textChanged( const QString& ) ), this, SLOT( onTextChanged( const QString& ) ) ); } QtxDblSpinBox::~QtxDblSpinBox() @@ -400,3 +404,11 @@ void QtxDblSpinBox::wheelEvent( QWheelEvent* e ) QSpinBox::wheelEvent( e ); updateDisplay(); } + +void QtxDblSpinBox::onTextChanged( const QString& str ) +{ + bool isBlock = myBlocked; + myBlocked = true; + interpretText(); + myBlocked = isBlock; +} diff --git a/src/Qtx/QtxDblSpinBox.h b/src/Qtx/QtxDblSpinBox.h index 9adb490bb..c905bcddc 100755 --- a/src/Qtx/QtxDblSpinBox.h +++ b/src/Qtx/QtxDblSpinBox.h @@ -47,7 +47,7 @@ public: signals: void valueChanged( double ); - void valueChanged( const QString& ); + void valueChanged( const QString& ); public slots: virtual void stepUp(); @@ -56,6 +56,9 @@ public slots: virtual void setValue( int ); virtual void setValue( double ); +protected slots: + virtual void onTextChanged( const QString& ); + protected: virtual void updateDisplay(); virtual void interpretText();