From: stv Date: Fri, 20 Jan 2006 13:09:10 +0000 (+0000) Subject: no message X-Git-Tag: SPDev_start~15 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=18ba83a5d4afc84d91de19175ac46a8e91ff48b0;p=modules%2Fgui.git no message --- diff --git a/src/QDS/QDS_CheckBox.cxx b/src/QDS/QDS_CheckBox.cxx index f6a8bd450..ded537716 100644 --- a/src/QDS/QDS_CheckBox.cxx +++ b/src/QDS/QDS_CheckBox.cxx @@ -18,6 +18,14 @@ QDS_CheckBox::~QDS_CheckBox() { } +/*! + Sets the state "NoChange" for checkbox. +*/ +void QDS_CheckBox::clear() +{ + setStringValue( "-1" ); +} + /*! Returns string from QCheckBox widget. */ @@ -37,17 +45,15 @@ void QDS_CheckBox::setString( const QString& txt ) if ( !checkBox() ) return; - if ( txt.isEmpty() ) + bool isOk; + int val = (int)txt.toDouble( &isOk ); + if ( isOk && val < 0 ) { checkBox()->setTristate(); checkBox()->setNoChange(); } else - { - bool isOk; - int val = (int)txt.toDouble( &isOk ); checkBox()->setChecked( isOk && val != 0 ); - } } /*! diff --git a/src/QDS/QDS_CheckBox.h b/src/QDS/QDS_CheckBox.h index e6d7c541d..8b1344b93 100644 --- a/src/QDS/QDS_CheckBox.h +++ b/src/QDS/QDS_CheckBox.h @@ -16,6 +16,8 @@ public: bool isChecked() const; void setChecked( const bool ); + virtual void clear(); + signals: void toggled( bool );