Workspace 6.21.5
|
This abstract class stores settings information and current value. It wraps around QMap that maps some type of settings Enum to a QVariant. More...
#include <Workspace/Application/settingsmap.h>
Classes | |
struct | Setting |
Public Member Functions | |
virtual QString | getParentTag () const =0 |
QString | getSerializableName (Enum setting) const |
QList< Enum > | getSettingTypes () const |
template<typename T > | |
bool | getValue (Enum setting, T &value) const |
void | loadAll (DataExecution::SerializedItem &parentItem) |
void | saveAll (DataExecution::SerializedItem &rootItem) |
template<typename T > | |
bool | setValue (Enum setting, const T &value) |
Enum | toEnum (const QString &name, bool &ok) |
Protected Member Functions | |
SettingsMap ()=default | |
virtual void | load (const DataExecution::SerializedItem &item) |
virtual void | save (Enum setting, DataExecution::SerializedItem &item) |
bool | validateMap () |
Protected Attributes | |
QMap< Enum, Setting > | map_ |
getParentTag must be implemented to return the tag name of the parent item of the setting category. Settings items are serialised as children to the parent item.
|
protecteddefault |
|
pure virtual |
Implemented in UserInterfaceMap.
|
inline |
setting | The specified setting |
|
inline |
|
inline |
setting | The specified setting |
value | The value of the setting is written to this variable. |
|
inlineprotectedvirtual |
Loads the value from the attribute of item
|
inline |
parentItem | The parent SerializedItem whose children are expected to be settings to load |
Removes all children of parentItem, loading each settings value from each child.
|
inlineprotectedvirtual |
Saves the setting value as an attribute of item
|
inline |
rootItem | The root settings item. |
Adds a new parent SerializedItem to rootItem if required. All settings will be saved as children of that parent item.
|
inline |
setting | The specified setting |
value | The value that will be set for the specified setting |
|
inline |
name | The serilizable name of a specified enum |
ok | Returns false when the name is unrecognised |
|
inlineprotected |
Call this function after initialising the map to validate
|
protected |