eVaf
prop.h
Go to the documentation of this file.
1 
20 #ifndef __COMMON_PROP_H
21 # define __COMMON_PROP_H
22 
23 #include "iprop.h"
24 
25 #include <QHash>
26 
27 class QSettings;
28 
29 namespace eVaf {
30 namespace Common {
31 namespace Internal {
32 
41 class Prop : public iProp
42 {
43  Q_OBJECT
44 
45 public:
46 
47  Prop();
48 
49  virtual ~Prop();
50 
54  iProp * _interface() const;
55 
60  bool init();
61 
65  void done();
66 
67  /*
68  iProp interface
69  */
70 
71  virtual QVariant getValue(QString const & name, QVariant const & defaultValue) const;
72 
73  virtual void setValue(QString const & name, QVariant const & value, bool persistent = false);
74 
75 
76 private: // Members
77 
79  QHash<QString, QVariant> mProps;
80 
82  QSettings * mPersistentProps;
83 
84 };
85 
86 } // namespace eVaf::Common::Internal
87 } // namespace eVaf::Common
88 } // namespace eVaf
89 
90 #endif // prop.h
bool init()
Initializes the iProp interface implementation.
Implementation of the iProp interface.
Definition: prop.h:41
void done()
Finalizes the iProp interface implementation.
virtual QVariant getValue(QString const &name, QVariant const &defaultValue) const
Returns the value of the global property or variable.
Global eVaf namespace.
Definition: engine.h:37
Global properties and variables for eVaf applications.
Definition: iprop.h:59
virtual void setValue(QString const &name, QVariant const &value, bool persistent=false)
Sets the global property or variable.
eVaf properties interface
iProp * _interface() const
Returns the current implementation of the iProp interface.