From f321c9a05338e1c10aad2439a76ee7dda4fdeece Mon Sep 17 00:00:00 2001 From: asl Date: Fri, 10 Jun 2005 05:37:30 +0000 Subject: [PATCH] IPAL9146 --- src/Qtx/QtxDblSpinBox.cxx | 12 ++++++++++++ src/Qtx/QtxDblSpinBox.h | 5 ++++- 2 files changed, 16 insertions(+), 1 deletion(-) 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(); -- 2.39.2