Settings Class Reference
[Settings]

Singelton that provides global acces to setting. More...

#include <settings.h>

Collaboration diagram for Settings:

Collaboration graph
[legend]
List of all members.

Public Member Functions

virtual ~Settings ()
void setValue (const QString &key, const QVariant &value)
void setValue (const std::string &key, const std::string &value)
void setValue (const std::string &key, const int value)
void setValue (const std::string &key, const double value)
QVariant getValue (const QString &key, const QVariant &default_value=QVariant()) const
std::string getStringValue (const std::string &key, const std::string &default_value="") const
int getIntValue (const std::string &key, const int default_value=0) const
double getDoubleValue (const std::string &key, const double default_value=0.0) const

Static Public Member Functions

static Settings *const getInstance ()

Detailed Description

Singelton that provides global acces to setting.

Singleton that provides the settings for the application Requires that the qt installation is compiled wit STL compatibility enabled

Author:
Tobias Gross (tobias.gross@imedgine.org)

Christian Koerner (christian.koerner@imedgine.org)

Alexander Lex (alexander.lex@imedgine.org)

Marc Streit (marc.streit@imedgine.org)

Martin Reininger (martin.reininger@imedgine.org)

Definition at line 45 of file settings.h.


Constructor & Destructor Documentation

~Settings  )  [virtual]
 

Destructor

Definition at line 32 of file settings.cpp.


Member Function Documentation

double getDoubleValue const std::string &  key,
const double  default_value = 0.0
const
 

Mapping of QSettings value Method Provided for convenience so that classes that don't want to use QT don't have to. If the setting doesn't exist, returns default_value. If no default value is specified, an empty string is returned

Parameters:
key The key for the settings entry
default_value (optional) The value that is returned if no value is found in the settings
Returns:
the value of the setting, or the default value if none was found

Definition at line 115 of file settings.cpp.

References Settings::getValue().

Here is the call graph for this function:

Settings *const getInstance  )  [static]
 

Static access method that returns a const pointer to the only instance of the class

Returns:
A const pointer to the only instance of the class

Definition at line 39 of file settings.cpp.

Referenced by Controller::loadConfiguration().

int getIntValue const std::string &  key,
const int  default_value = 0
const
 

Mapping of QSettings value Method Provided for convenience so that classes that don't want to use QT don't have to. If the setting doesn't exist, returns default_value. If no default value is specified, an empty string is returned

Parameters:
key The key for the settings entry
default_value (optional) The value that is returned if no value is found in the settings
Returns:
the value of the setting, or the default value if none was found

Definition at line 105 of file settings.cpp.

References Settings::getValue().

Here is the call graph for this function:

std::string getStringValue const std::string &  key,
const std::string &  default_value = ""
const
 

Mapping of QSettings value Method Provided for convenience so that classes that don't want to use QT don't have to. If the setting doesn't exist, returns default_value. If no default value is specified, an empty string is returned

Parameters:
key The key for the settings entry
default_value (optional) The value that is returned if no value is found in the settings
Returns:
the value of the setting, or the default value if none was found

Definition at line 95 of file settings.cpp.

References Settings::getValue().

Here is the call graph for this function:

QVariant getValue const QString &  key,
const QVariant &  default_value = QVariant()
const
 

Mapping of QSettings value Method Returns the value for setting key. If the setting doesn't exist, returns defaultValue. If no default value is specified, a default QVariant is returned. This can be tested using bool QVariant::isValid () const If a default_value is specified this is returned

Parameters:
key The key of the settings entry
default_value (optional) The value that is returned if no value is found in the settings
Returns:
the value of the setting, or the default value if none was found

Definition at line 88 of file settings.cpp.

Referenced by Settings::getDoubleValue(), Settings::getIntValue(), and Settings::getStringValue().

void setValue const std::string &  key,
const double  value
 

Convinience Method for Classes that do not want to handle QT. It takes one std::strings and an int, internally casts them to QStrings ans QVariants. This method allows to use the settings without having to worry about qt at all.

Parameters:
key The key Qtring
value The value of the new settings entry.

Definition at line 78 of file settings.cpp.

References Settings::setValue().

Here is the call graph for this function:

void setValue const std::string &  key,
const int  value
 

Convinience Method for Classes that do not want to handle QT. It takes one std::strings and an int, internally casts them to QStrings ans QVariants. This method allows to use the settings without having to worry about qt at all.

Parameters:
key The key Qtring
value The value of the new settings entry.

Definition at line 68 of file settings.cpp.

References Settings::setValue().

Here is the call graph for this function:

void setValue const std::string &  key,
const std::string &  value
 

Convinience Method for Classes that do not want to handle QT. It takes two std::strings and internally casts them to QStrings ans QVariants. This method allows to use the settings without having to worry about qt at all.

Parameters:
key The key Qtring
value The value of the new settings entry.

Definition at line 58 of file settings.cpp.

References Settings::setValue().

Here is the call graph for this function:

void setValue const QString &  key,
const QVariant &  value
 

Mapping of QSettings setValue Method

Parameters:
key The key Qtring
value The value of the new settings entry.

Definition at line 51 of file settings.cpp.

Referenced by Settings::setValue().


The documentation for this class was generated from the following files:
Generated on Sun Aug 13 18:20:04 2006 for iMEDgine by  doxygen 1.4.6