diff --git a/include/automatable_model.h b/include/automatable_model.h index 647a79fc6..a99457518 100644 --- a/include/automatable_model.h +++ b/include/automatable_model.h @@ -210,18 +210,6 @@ public: } - virtual QString displayName( void ) const - { - return m_displayName; - } - - virtual void setDisplayName( const QString & _display_name ) - { - m_displayName = _display_name; - } - - - public slots: virtual void reset( void ); virtual void copyValue( void ); @@ -248,9 +236,9 @@ private: float m_step; float m_range; - // most objects will need this temporarily (until sampleExact is standard) + // most objects will need this temporarily (until sampleExact is + // standard) float m_oldValue; - QString m_displayName; bool m_journalEntryReady; autoModelVector m_linkedModels; @@ -324,8 +312,7 @@ public: class boolModel : public automatableModel { public: - boolModel( const bool _val = FALSE, - ::model * _parent = NULL, + boolModel( const bool _val = FALSE, ::model * _parent = NULL, const QString & _display_name = QString::null, bool _default_constructed = FALSE ) : automatableModel( Bool, _val, FALSE, TRUE, 1, diff --git a/include/mv_base.h b/include/mv_base.h index 4e9135b78..1cac53724 100644 --- a/include/mv_base.h +++ b/include/mv_base.h @@ -39,8 +39,10 @@ class EXPORT model : public QObject { Q_OBJECT public: - model( model * _parent, bool _default_constructed = FALSE ) : + model( model * _parent, QString _display_name = QString::null, + bool _default_constructed = FALSE ) : QObject( _parent ), + m_displayName( _display_name ), m_defaultConstructed( _default_constructed ) { } @@ -61,16 +63,18 @@ public: virtual QString displayName( void ) const { - return QString(); + return m_displayName; } - void setDisplayName( const QString & _displayName ) + virtual void setDisplayName( const QString & _display_name ) { + m_displayName = _display_name; } virtual QString fullDisplayName( void ) const; private: + QString m_displayName; bool m_defaultConstructed; signals: diff --git a/src/core/automatable_model.cpp b/src/core/automatable_model.cpp index f1d125d50..de19c4ca6 100644 --- a/src/core/automatable_model.cpp +++ b/src/core/automatable_model.cpp @@ -52,7 +52,7 @@ automatableModel::automatableModel( DataType _type, ::model * _parent, const QString & _display_name, bool _default_constructed ) : - model( _parent, _default_constructed ), + model( _parent, _display_name, _default_constructed ), m_dataType( _type ), m_value( _val ), m_initValue( _val ), @@ -60,7 +60,6 @@ automatableModel::automatableModel( DataType _type, m_maxValue( _max ), m_step( _step ), m_range( _max - _min ), - m_displayName( _display_name ), m_journalEntryReady( FALSE ), m_controllerConnection( NULL ) {