From ad262ad2d28b8bac8e9ad3637bc3a2c826c059d9 Mon Sep 17 00:00:00 2001 From: rnv Date: Wed, 12 Nov 2008 14:20:44 +0000 Subject: [PATCH] SetTest() method added. --- src/SalomeApp/SalomeApp_DoubleSpinBox.cxx | 9 +++++++++ src/SalomeApp/SalomeApp_DoubleSpinBox.h | 2 ++ src/SalomeApp/SalomeApp_IntSpinBox.cxx | 9 +++++++++ src/SalomeApp/SalomeApp_IntSpinBox.h | 2 ++ 4 files changed, 22 insertions(+) diff --git a/src/SalomeApp/SalomeApp_DoubleSpinBox.cxx b/src/SalomeApp/SalomeApp_DoubleSpinBox.cxx index 6d048f967..86503d452 100644 --- a/src/SalomeApp/SalomeApp_DoubleSpinBox.cxx +++ b/src/SalomeApp/SalomeApp_DoubleSpinBox.cxx @@ -238,6 +238,15 @@ void SalomeApp_DoubleSpinBox::setValue( const double value ) myCorrectValue = QString::number( value ); } +/*! + \brief This function is used to set a text for this spinbox. + \param value current value +*/ +void SalomeApp_DoubleSpinBox::setText( const QString& value ) +{ + lineEdit()->setText(value); +} + /*! \brief This function is used to determine whether input is valid. \return validating operation result diff --git a/src/SalomeApp/SalomeApp_DoubleSpinBox.h b/src/SalomeApp/SalomeApp_DoubleSpinBox.h index 867c2d24b..0827e01d1 100644 --- a/src/SalomeApp/SalomeApp_DoubleSpinBox.h +++ b/src/SalomeApp/SalomeApp_DoubleSpinBox.h @@ -52,6 +52,8 @@ public: virtual void setRange( double, double ); virtual void setValue( double ); + virtual void setText(const QString& ); + protected: State isValid( const QString&, double& ) const; diff --git a/src/SalomeApp/SalomeApp_IntSpinBox.cxx b/src/SalomeApp/SalomeApp_IntSpinBox.cxx index 14b003645..c3014e6e0 100644 --- a/src/SalomeApp/SalomeApp_IntSpinBox.cxx +++ b/src/SalomeApp/SalomeApp_IntSpinBox.cxx @@ -194,6 +194,15 @@ void SalomeApp_IntSpinBox::setValue( const int value ) myCorrectValue = QString::number( value ); } +/*! + \brief This function is used to set a text for this spinbox. + \param value current value +*/ +void SalomeApp_IntSpinBox::setText( const QString& value ) +{ + lineEdit()->setText(value); +} + /*! \brief This function is used to determine whether input is valid. \return validating operation result diff --git a/src/SalomeApp/SalomeApp_IntSpinBox.h b/src/SalomeApp/SalomeApp_IntSpinBox.h index 000cfb3ff..e894884c1 100644 --- a/src/SalomeApp/SalomeApp_IntSpinBox.h +++ b/src/SalomeApp/SalomeApp_IntSpinBox.h @@ -50,6 +50,8 @@ public: virtual void setValue( int ); + virtual void setText(const QString& ); + protected: State isValid( const QString&, int& ) const; -- 2.39.2