Generic implementation of librepcb::WorkspaceSettingsItem for simple, value-in-list-type settings.
More...
#include <workspacesettingsitem_genericvaluelist.h>
template<typename T>
class librepcb::WorkspaceSettingsItem_GenericValueList< T >
Generic implementation of librepcb::WorkspaceSettingsItem for simple, value-in-list-type settings.
◆ WorkspaceSettingsItem_GenericValueList() [1/3]
◆ WorkspaceSettingsItem_GenericValueList() [2/3]
◆ WorkspaceSettingsItem_GenericValueList() [3/3]
◆ ~WorkspaceSettingsItem_GenericValueList()
◆ get()
Get the current value.
- Returns
- Current value
◆ contains()
bool contains |
( |
const typename T::value_type & |
item | ) |
const |
|
inlinenoexcept |
Check if the current value contains a praticular item.
- Parameters
-
- Returns
- Whether the item is contained in the current value or not.
◆ set()
void set |
( |
const T & |
value | ) |
|
|
inlinenoexcept |
Set the value.
- Parameters
-
◆ add()
void add |
( |
const typename T::value_type & |
item | ) |
|
|
inlinenoexcept |
Add a single item to the value list.
- Parameters
-
item | The item to append (list) or insert (unordered set) |
◆ getDefault()
const T & getDefault |
( |
| ) |
const |
|
inlinenoexcept |
Get the default value.
- Returns
- Default value
◆ operator=()
◆ restoreDefaultImpl()
virtual void restoreDefaultImpl |
( |
| ) |
|
|
inlineoverrideprivatevirtualnoexcept |
◆ loadImpl()
|
inlineoverrideprivatevirtual |
Load value from S-Expression node.
- Parameters
-
root | S-Expression node of the settings element. |
- Note
- Implementation must emit the edited() signal if the value has changed.
-
Implementation must be atomic, i.e. either the value must be loaded completely from file, or left at the old value (in case of errors).
Implements WorkspaceSettingsItem.
◆ makeCanonical() [1/2]
T makeCanonical |
( |
const QList< typename T::value_type > & |
value | ) |
const |
|
inlineprivatenoexcept |
Helper for serialization of QList.
- Parameters
-
- Returns
- Unmodified value.
◆ makeCanonical() [2/2]
QList< typename T::value_type > makeCanonical |
( |
const QSet< typename T::value_type > & |
value | ) |
const |
|
inlineprivatenoexcept |
Helper for serialization of QSet.
- Parameters
-
- Returns
- QSet as a sorted QList.
◆ serializeImpl()
|
inlineoverrideprivatevirtual |
Serialize the value into S-Expression node.
- Parameters
-
root | S-Expression node to be updated. |
Implements WorkspaceSettingsItem.
◆ mItemKey
Inner key used for serialization.
◆ mDefaultValue
◆ mCurrentValue
The documentation for this class was generated from the following file: