Salome HOME
IPAL9146
authorasl <asl@opencascade.com>
Fri, 10 Jun 2005 05:37:30 +0000 (05:37 +0000)
committerasl <asl@opencascade.com>
Fri, 10 Jun 2005 05:37:30 +0000 (05:37 +0000)
src/Qtx/QtxDblSpinBox.cxx
src/Qtx/QtxDblSpinBox.h

index 0d7b22ff4660b48b2f45dde6438370721598cf8f..430901771047aeb38b01d6091da01cc4e87c1070 100755 (executable)
@@ -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;
+}
index 9adb490bb04392d2050d81c895b7ee94b2bc97c8..c905bcddccd109202f2346ac6714f282e5a6dff3 100755 (executable)
@@ -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();