Generic implementation of librepcb::WorkspaceSettingsItem for simple, value-in-list-type settings.
More...
#include <workspacesettingsitem_genericvaluelist.h>
|
virtual void | restoreDefaultImpl () noexcept override |
| Restore default value.
|
|
void | loadImpl (const SExpression &root) override |
| Load value from S-Expression node.
|
|
T | makeCanonical (const QList< typename T::value_type > &value) const noexcept |
| Helper for serialization of QList.
|
|
QList< typename T::value_type > | makeCanonical (const QSet< typename T::value_type > &value) const noexcept |
| Helper for serialization of QSet.
|
|
void | serializeImpl (SExpression &root) const override |
| Serialize the value into S-Expression node.
|
|
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()
template<typename T >
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()
template<typename T >
void set |
( |
const T & |
value | ) |
|
|
inlinenoexcept |
Set the value.
- Parameters
-
◆ add()
template<typename T >
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()
template<typename T >
const T & getDefault |
( |
| ) |
const |
|
inlinenoexcept |
Get the default value.
- Returns
- Default value
◆ operator=()
◆ restoreDefaultImpl()
template<typename T >
virtual void restoreDefaultImpl |
( |
| ) |
|
|
inlineoverrideprivatevirtualnoexcept |
◆ loadImpl()
template<typename T >
|
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]
template<typename T >
T makeCanonical |
( |
const QList< typename T::value_type > & |
value | ) |
const |
|
inlineprivatenoexcept |
Helper for serialization of QList.
- Parameters
-
- Returns
- Unmodified value.
◆ makeCanonical() [2/2]
template<typename T >
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()
template<typename T >
|
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: