From 18ba83a5d4afc84d91de19175ac46a8e91ff48b0 Mon Sep 17 00:00:00 2001 From: stv Date: Fri, 20 Jan 2006 13:09:10 +0000 Subject: [PATCH] no message --- src/QDS/QDS_CheckBox.cxx | 16 +++++++++++----- src/QDS/QDS_CheckBox.h | 2 ++ 2 files changed, 13 insertions(+), 5 deletions(-) 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 ); -- 2.39.2