LibrePCB Developers Documentation
|
Generic implementation of librepcb::WorkspaceSettingsItem for simple, value-type settings. More...
#include <workspacesettingsitem_genericvalue.h>
Public Member Functions | |
WorkspaceSettingsItem_GenericValue ()=delete | |
WorkspaceSettingsItem_GenericValue (const WorkspaceSettingsItem_GenericValue &other)=delete | |
WorkspaceSettingsItem_GenericValue (const QString &key, const T &defaultValue, QObject *parent=nullptr) noexcept | |
~WorkspaceSettingsItem_GenericValue () noexcept | |
const T & | get () const noexcept |
Get the current value. More... | |
void | set (const T &value) noexcept |
Set the value. More... | |
const T & | getDefault () const noexcept |
Get the default value. More... | |
WorkspaceSettingsItem_GenericValue & | operator= (const WorkspaceSettingsItem_GenericValue &rhs)=delete |
Public Member Functions inherited from WorkspaceSettingsItem | |
WorkspaceSettingsItem ()=delete | |
WorkspaceSettingsItem (const QString &key, QObject *parent=nullptr) noexcept | |
WorkspaceSettingsItem (const WorkspaceSettingsItem &other)=delete | |
virtual | ~WorkspaceSettingsItem () noexcept |
const QString & | getKey () const noexcept |
Get the setting key used for serialization. More... | |
bool | isDefaultValue () const noexcept |
Check whether this setting is at its default value (not modified) More... | |
bool | isEdited () const noexcept |
Check whether this setting was edited sinc the last load or save. More... | |
void | restoreDefault () noexcept |
Restore default value. More... | |
void | load (const SExpression &root) |
Load value from S-Expression file. More... | |
void | serialize (SExpression &root) const |
Serialize the value into S-Expression nodes. More... | |
WorkspaceSettingsItem & | operator= (const WorkspaceSettingsItem &rhs)=delete |
Private Member Functions | |
virtual void | restoreDefaultImpl () noexcept override |
Restore default value. More... | |
void | loadImpl (const SExpression &root) override |
Load value from S-Expression node. More... | |
void | serializeImpl (SExpression &root) const override |
Serialize the value into S-Expression node. More... | |
Private Attributes | |
T | mDefaultValue |
Initial, default value. More... | |
T | mCurrentValue |
Current value. More... | |
Additional Inherited Members | |
Signals inherited from WorkspaceSettingsItem | |
void | edited () |
Signal to notify about changes of the settings value. More... | |
Protected Member Functions inherited from WorkspaceSettingsItem | |
void | valueModified () noexcept |
virtual void | restoreDefaultImpl () noexcept=0 |
Restore default value. More... | |
virtual void | loadImpl (const SExpression &root)=0 |
Load value from S-Expression node. More... | |
virtual void | serializeImpl (SExpression &root) const =0 |
Serialize the value into S-Expression node. More... | |
Generic implementation of librepcb::WorkspaceSettingsItem for simple, value-type settings.
|
delete |
|
delete |
|
inlineexplicitnoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
Get the current value.
|
inlinenoexcept |
Set the value.
value | The new value |
|
inlinenoexcept |
Get the default value.
|
delete |
|
inlineoverrideprivatevirtualnoexcept |
Restore default value.
Implements WorkspaceSettingsItem.
|
inlineoverrideprivatevirtual |
Load value from S-Expression node.
root | S-Expression node of the settings element. |
Implements WorkspaceSettingsItem.
|
inlineoverrideprivatevirtual |
Serialize the value into S-Expression node.
root | S-Expression node to be updated. |
Implements WorkspaceSettingsItem.
|
private |
Initial, default value.
|
private |
Current value.