Updraft
1.0
Open source glider flight visualisation tool.
|
Implementation of the setting interface. More...
#include <basicsetting.h>
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 |
Implementation of the setting interface.
Updraft::Core::BasicSetting::BasicSetting | ( | SettingsItem * | settingItem, |
SettingsManager * | mgr | ||
) | [private] |
Only SettingsManager can construct this class.
That's why this constructor is private.
settingItem | Pointer to the associated SettingItem instance in the SettingsModel |
mgr | Pointer to the application's settings manager. |
void Updraft::Core::BasicSetting::callOnValueChanged | ( | QObject * | slotOwner, |
const char * | slot | ||
) | [virtual] |
Connects a slot that should be called whenever the value changes.
slotOwner | pointer to the QObject owning the target slot. |
slot | Name of the slot to be called. This can be obtained using the SLOT(foo()) syntax. |
Implements Updraft::SettingInterface.
void Updraft::Core::BasicSetting::emitValueChanged | ( | ) | [inline, private] |
A private function that emits the value change signal.
QVariant Updraft::Core::BasicSetting::get | ( | ) | [virtual] |
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.
newValue | The 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.
newDescription | The 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.
needsRestart | Whether the flag should be set or unset |
Implements Updraft::SettingInterface.
void Updraft::Core::BasicSetting::valueChanged | ( | ) | [signal] |
This is the signal that is emited when the value of the setting changes.
friend class SettingsDelegate [friend] |
friend class SettingsManager [friend] |
SettingsItem* Updraft::Core::BasicSetting::item [private] |
Pointer to the value item.
Internal pointer to the settings manager.