SettingsModel Class Reference

#include <settingsmodel.h>

Inheritance diagram for SettingsModel:

AbstractModel MvcBase List of all members.

Public Member Functions

 SettingsModel (const QString &organization, const QString &application=QString(), QObject *parent=0)
 SettingsModel (QSettings::Scope scope, const QString &organization, const QString &application=QString(), QObject *parent=0)
 SettingsModel (QSettings::Format format, QSettings::Scope scope, const QString &organization, const QString &application=QString(), QObject *parent=0)
 SettingsModel (const QString &fileName, QSettings::Format format, QObject *parent=0)
 SettingsModel (QObject *parent=0)
SettingsControllersettingsController () const
const QSettings * constSettings () const
QVariant value (const QString &key, const QVariant &defaultValue=QVariant()) const
virtual MvcModuleId_t moduleId () const

Static Public Member Functions

static MvcModuleId_t classModuleId ()

Protected Member Functions

virtual void customEvent (QEvent *e)
virtual void dispatchEvent (MEvent *)
virtual void changeControllerEvent (MChangeControllerEvent *)
virtual void settingsChangeValueEvent (MSettingsChangeValueEvent *)
virtual void settingsRemoveKeyEvent (MSettingsRemoveKeyEvent *)
virtual void settingsRemoveAllEvent (MSettingsEvent *)
virtual void settingsSyncAllEvent (MSettingsEvent *)
QSettings * settings () const

Constructor & Destructor Documentation

SettingsModel::SettingsModel ( const QString &  organization,
const QString &  application = QString(),
QObject *  parent = 0 
)

Constructs a settings model with the given parent.

SettingsModel::SettingsModel ( QSettings::Scope  scope,
const QString &  organization,
const QString &  application = QString(),
QObject *  parent = 0 
)

Constructs a settings model with the given parent.

SettingsModel::SettingsModel ( QSettings::Format  format,
QSettings::Scope  scope,
const QString &  organization,
const QString &  application = QString(),
QObject *  parent = 0 
)

Constructs a settings model with the given parent.

SettingsModel::SettingsModel ( const QString &  fileName,
QSettings::Format  format,
QObject *  parent = 0 
)

Constructs a settings model with the given parent.

SettingsModel::SettingsModel ( QObject *  parent = 0  ) 

Constructs a settings model with the given parent.


Member Function Documentation

SettingsController * SettingsModel::settingsController (  )  const

Convenience method.

Returns a cached guarded pointer that has been dynamically cast to SettingsController* from AbstractController*.

See also AbstractModel::controller().

const QSettings * SettingsModel::constSettings (  )  const

Returns a const version of QSettings for reading from.

QVariant SettingsModel::value ( const QString &  key,
const QVariant &  defaultValue = QVariant() 
) const

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.

static MvcModuleId_t SettingsModel::classModuleId (  )  [inline, static]

Returns MvcSettings::id().

Reimplemented from MvcBase.

virtual MvcModuleId_t SettingsModel::moduleId (  )  const [inline, virtual]

Returns classModuleId().

Reimplemented from MvcBase.

virtual void SettingsModel::customEvent ( QEvent *  e  )  [inline, protected, virtual]

void SettingsModel::dispatchEvent ( MEvent event  )  [protected, virtual]

The model's event dispatcher.

Asserts that the event is non-null.

Warning! It is assumed that the events have their correct type set (as it uses static casts).

Reimplemented from AbstractModel.

void SettingsModel::changeControllerEvent ( MChangeControllerEvent event  )  [protected, virtual]

Re-implemented, as to also have the pointer returned by settingsController() updated.

Asserts that the event is non-null.

Reimplemented from AbstractModel.

void SettingsModel::settingsChangeValueEvent ( MSettingsChangeValueEvent event  )  [protected, virtual]

Changes the value of the given setting event()->key to event->value().

If a value for the given key doesn't already exist, then it will be added.

Asserts that the event is non-null.

void SettingsModel::settingsRemoveKeyEvent ( MSettingsRemoveKeyEvent event  )  [protected, virtual]

Removes the setting event->key() and any sub-settings of it.

Asserts that the event is non-null.

void SettingsModel::settingsRemoveAllEvent ( MSettingsEvent  )  [protected, virtual]

Removes all entries in the primary location.

void SettingsModel::settingsSyncAllEvent ( MSettingsEvent  )  [protected, virtual]

Writes any unsaved changes to permanent storage, and reloads any settings that have been changed in the meantime (possibly by another application).

Asserts that the event is non-null.

QSettings * SettingsModel::settings (  )  const [protected]

Returns a non-const version of QSettings for use by sub-classes.


The documentation for this class was generated from the following files:
Generated on Mon Jul 30 09:46:53 2007 for Digest by  doxygen 1.5.2