eVaf
|
Implementation of the iProp interface. More...
#include <Common/prop.h>
Public Member Functions | |
iProp * | _interface () const |
Returns the current implementation of the iProp interface. More... | |
void | done () |
Finalizes the iProp interface implementation. More... | |
virtual QVariant | getValue (QString const &name, QVariant const &defaultValue) const |
Returns the value of the global property or variable. More... | |
bool | init () |
Initializes the iProp interface implementation. More... | |
Prop () | |
virtual void | setValue (QString const &name, QVariant const &value, bool persistent=false) |
Sets the global property or variable. More... | |
virtual | ~Prop () |
Public Member Functions inherited from eVaf::Common::iProp | |
iProp () | |
Interface constructor. More... | |
virtual | ~iProp () |
Empty virtual dtor. More... | |
Additional Inherited Members | |
Signals inherited from eVaf::Common::iProp | |
void | valueChanged (QString const &name, QVariant const &value) |
Global property or variable changed. More... | |
Static Public Member Functions inherited from eVaf::Common::iProp | |
static iProp * | instance () |
Returns the iProp interface instance. More... | |
Implementation of the iProp interface.
This class implements the iProp interface for global properties and variables. Persistent properties are stored in the file '.<appname>.dat' in the directory returned with the eVaf::Common::iApp::dataRootDir() function. The file is in the QSettings::IniFormat format.
eVaf::Common::Internal::Prop::Prop | ( | ) |
|
virtual |
iProp* eVaf::Common::Internal::Prop::_interface | ( | ) | const |
Returns the current implementation of the iProp interface.
void eVaf::Common::Internal::Prop::done | ( | ) |
Finalizes the iProp interface implementation.
|
virtual |
Returns the value of the global property or variable.
name | Name of the property |
defaultValue | Default value |
The getValue() function returns a global property or variable identified by the name. If the property is not found, returns the default value.
Implements eVaf::Common::iProp.
bool eVaf::Common::Internal::Prop::init | ( | ) |
Initializes the iProp interface implementation.
|
virtual |
Sets the global property or variable.
name | Name of the property |
value | Value of the property |
persistent | If True, then the property is stored permanently |
The setValue() function sets the value of a global property or variable identified by the name. The property is added if it does not exist. Set the persistent argument to True to make the change permanent.
The valueChanged() signal is emitted indicating that a property changed.
Implements eVaf::Common::iProp.