Updraft  1.0
Open source glider flight visualisation tool.
Updraft::Core::BasicSetting Class Reference

Implementation of the setting interface. More...

#include <basicsetting.h>

Inheritance diagram for Updraft::Core::BasicSetting:
Collaboration diagram for Updraft::Core::BasicSetting:

List of all members.

Signals

void valueChanged ()
 This is the signal that is emited when the value of the setting changes.

Public Member Functions

 ~BasicSetting ()
QVariant get ()
void set (const QVariant &newValue)
 Sets the value of the associated setting.
void setDescription (const QString &newDescription)
 Sets the description string for the settings dialog.
void setNeedsRestart (bool needsRestart)
 Sets/unsets the needs_restart flag of the setting.
void callOnValueChanged (QObject *slotOwner, const char *slot)
 Connects a slot that should be called whenever the value changes.

Private Member Functions

void emitValueChanged ()
 A private function that emits the value change signal.
 BasicSetting (SettingsItem *settingItem, SettingsManager *mgr)
 Only SettingsManager can construct this class.
void invalidate ()
 Invalidates the item pointer.

Private Attributes

SettingsItem * item
 Pointer to the value item.
SettingsManager * settingsManager
 Internal pointer to the settings manager.

Friends

class SettingsManager
class SettingsDelegate

Detailed Description

Implementation of the setting interface.


Constructor & Destructor Documentation

Only SettingsManager can construct this class.

That's why this constructor is private.

Parameters:
settingItemPointer to the associated SettingItem instance in the SettingsModel
mgrPointer to the application's settings manager.

Member Function Documentation

void Updraft::Core::BasicSetting::callOnValueChanged ( QObject *  slotOwner,
const char *  slot 
) [virtual]

Connects a slot that should be called whenever the value changes.

Parameters:
slotOwnerpointer to the QObject owning the target slot.
slotName of the slot to be called. This can be obtained using the SLOT(foo()) syntax.

Implements Updraft::SettingInterface.

A private function that emits the value change signal.

QVariant Updraft::Core::BasicSetting::get ( ) [virtual]
Returns:
Current value of the associated setting.

Implements Updraft::SettingInterface.

void Updraft::Core::BasicSetting::invalidate ( ) [inline, private]

Invalidates the item pointer.

void Updraft::Core::BasicSetting::set ( const QVariant &  newValue) [virtual]

Sets the value of the associated setting.

Parameters:
newValueThe new value of the setting.

Implements Updraft::SettingInterface.

void Updraft::Core::BasicSetting::setDescription ( const QString &  newDescription) [virtual]

Sets the description string for the settings dialog.

Parameters:
newDescriptionThe new description of the setting in the dialog.

Implements Updraft::SettingInterface.

void Updraft::Core::BasicSetting::setNeedsRestart ( bool  needsRestart) [virtual]

Sets/unsets the needs_restart flag of the setting.

This flag is used to display an asterisk next to settings that need the application to restart after their value is changed.

Parameters:
needsRestartWhether the flag should be set or unset

Implements Updraft::SettingInterface.

This is the signal that is emited when the value of the setting changes.


Friends And Related Function Documentation

friend class SettingsDelegate [friend]
friend class SettingsManager [friend]

Member Data Documentation

Pointer to the value item.

Internal pointer to the settings manager.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines