From a14f262b7592d1ecebd1f6966ea2e18be3fb41df Mon Sep 17 00:00:00 2001 From: san Date: Sat, 12 May 2012 11:45:09 +0000 Subject: [PATCH] QDS_Datum::getString() made public to allow reading the value text currently displayed in the control "as is" without any conversions. This is needed when embedding QDS widgets into item views. --- src/QDS/QDS_CheckBox.h | 3 ++- src/QDS/QDS_ComboBox.h | 3 ++- src/QDS/QDS_Datum.h | 3 ++- src/QDS/QDS_LineEdit.h | 3 ++- src/QDS/QDS_RadioBox.h | 3 ++- src/QDS/QDS_SpinBox.h | 3 ++- src/QDS/QDS_SpinBoxDbl.h | 3 ++- src/QDS/QDS_TextEdit.h | 3 ++- 8 files changed, 16 insertions(+), 8 deletions(-) diff --git a/src/QDS/QDS_CheckBox.h b/src/QDS/QDS_CheckBox.h index 6f1fbf37d..a675244e1 100644 --- a/src/QDS/QDS_CheckBox.h +++ b/src/QDS/QDS_CheckBox.h @@ -38,6 +38,8 @@ public: bool isChecked() const; void setChecked( const bool ); + virtual QString getString() const; + virtual void clear(); signals: @@ -51,7 +53,6 @@ protected: QCheckBox* checkBox() const; virtual QWidget* createControl( QWidget* ); - virtual QString getString() const; virtual void setString( const QString& ); }; diff --git a/src/QDS/QDS_ComboBox.h b/src/QDS/QDS_ComboBox.h index aa1aa5bb6..fa32f9913 100644 --- a/src/QDS/QDS_ComboBox.h +++ b/src/QDS/QDS_ComboBox.h @@ -62,6 +62,8 @@ public: void setValues( const QList&, const QStringList& ); void setValues( const QStringList& ); + virtual QString getString() const; + virtual void reset(); int stringToValue( const QString& ) const; @@ -79,7 +81,6 @@ protected: QtxComboBox* comboBox() const; virtual QWidget* createControl( QWidget* ); - virtual QString getString() const; virtual void setString( const QString& ); virtual void unitSystemChanged( const QString& ); diff --git a/src/QDS/QDS_Datum.h b/src/QDS/QDS_Datum.h index 01657fd5e..286407bf6 100644 --- a/src/QDS/QDS_Datum.h +++ b/src/QDS/QDS_Datum.h @@ -114,6 +114,8 @@ public: static QString format( const double, const QString&, const bool = false ); static QString units( const QString& ); + virtual QString getString() const = 0; + virtual bool eventFilter( QObject*, QEvent* ); operator QWidget*() const; @@ -151,7 +153,6 @@ protected: virtual QLabel* createUnits( QWidget* ); virtual QWidget* createControl( QWidget* ) = 0; - virtual QString getString() const = 0; virtual void setString( const QString& ) = 0; virtual bool validate( const QString& ) const; diff --git a/src/QDS/QDS_LineEdit.h b/src/QDS/QDS_LineEdit.h index 772e1067f..01e2a19a9 100644 --- a/src/QDS/QDS_LineEdit.h +++ b/src/QDS/QDS_LineEdit.h @@ -47,6 +47,8 @@ public: bool hasSelection() const; void setSelection( const bool ); + virtual QString getString() const; + signals: void returnPressed(); @@ -60,7 +62,6 @@ protected: virtual QWidget* createControl( QWidget* ); QLineEdit* lineEdit() const; - virtual QString getString() const; virtual void setString( const QString& ); virtual void unitSystemChanged( const QString& ); diff --git a/src/QDS/QDS_RadioBox.h b/src/QDS/QDS_RadioBox.h index f4b03e658..4e4344b1a 100644 --- a/src/QDS/QDS_RadioBox.h +++ b/src/QDS/QDS_RadioBox.h @@ -58,6 +58,8 @@ public: void setValues( const QList&, const QStringList& ); void setValues( const QStringList& ); + virtual QString getString() const; + signals: void activated( int ); @@ -70,7 +72,6 @@ protected: virtual QWidget* createControl( QWidget* ); void buttons( QList& ) const; - virtual QString getString() const; virtual void setString( const QString& ); virtual void unitSystemChanged( const QString& ); diff --git a/src/QDS/QDS_SpinBox.h b/src/QDS/QDS_SpinBox.h index dce4be4c8..e55638460 100644 --- a/src/QDS/QDS_SpinBox.h +++ b/src/QDS/QDS_SpinBox.h @@ -38,6 +38,8 @@ public: int step() const; void setStep( const int ); + virtual QString getString() const; + private slots: void onValueChanged( int ); @@ -46,7 +48,6 @@ protected: virtual QWidget* createControl( QWidget* ); - virtual QString getString() const; virtual void setString( const QString& ); virtual void unitSystemChanged( const QString& ); diff --git a/src/QDS/QDS_SpinBoxDbl.h b/src/QDS/QDS_SpinBoxDbl.h index 614a9573c..34dad379d 100644 --- a/src/QDS/QDS_SpinBoxDbl.h +++ b/src/QDS/QDS_SpinBoxDbl.h @@ -38,6 +38,8 @@ public: double step() const; void setStep( const double ); + virtual QString getString() const; + private slots: void onValueChanged( double ); @@ -45,7 +47,6 @@ protected: QtxDoubleSpinBox* spinBox() const; virtual QWidget* createControl( QWidget* ); - virtual QString getString() const; virtual void setString( const QString& ); virtual void unitSystemChanged( const QString& ); diff --git a/src/QDS/QDS_TextEdit.h b/src/QDS/QDS_TextEdit.h index efe5d1e1c..cf6a163b9 100644 --- a/src/QDS/QDS_TextEdit.h +++ b/src/QDS/QDS_TextEdit.h @@ -35,6 +35,8 @@ public: QDS_TextEdit( const QString&, QWidget* = 0, const int = All, const QString& = QString() ); virtual ~QDS_TextEdit(); + virtual QString getString() const; + signals: void returnPressed(); @@ -45,7 +47,6 @@ protected: QTextEdit* textEdit() const; virtual QWidget* createControl( QWidget* ); - virtual QString getString() const; virtual void setString( const QString& ); }; -- 2.39.2