eVaf
eVaf::Common::Internal::Prop Class Reference

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 iPropinstance ()
 Returns the iProp interface instance. More...
 

Detailed Description

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.

Definition at line 41 of file prop.h.

Constructor & Destructor Documentation

eVaf::Common::Internal::Prop::Prop ( )
virtual eVaf::Common::Internal::Prop::~Prop ( )
virtual

Member Function Documentation

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 QVariant eVaf::Common::Internal::Prop::getValue ( QString const &  name,
QVariant const &  defaultValue 
) const
virtual

Returns the value of the global property or variable.

Parameters
nameName of the property
defaultValueDefault value
Returns
The value of the global property or the default value if the property cannot be found

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.

Returns
True if succeeded; false if not
virtual void eVaf::Common::Internal::Prop::setValue ( QString const &  name,
QVariant const &  value,
bool  persistent = false 
)
virtual

Sets the global property or variable.

Parameters
nameName of the property
valueValue of the property
persistentIf 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.


The documentation for this class was generated from the following file: