Class: QgsSettingsEntryBaseTemplateQVariantMapBase¶
Base abstract class for settings entries with typed get and set methods
See also
Added in version 3.32.
Class Hierarchy¶
Base classes¶
Represent settings entry and provides methods for reading and writing settings values. Different subclasses are provided for different settings types with metainformations to validate set values and provide more accurate settings description for the gui. |
Subclasses¶
A string list settings entry. |
Methods
Check if the value is valid |
|
Converts the variant value to the value type of the setting |
|
Converts the value to a variant |
|
Returns settings default value. |
|
Returns the former value. |
|
Set settings value. |
|
Sets the settings value with an optional list of dynamic parts |
|
Returns settings value. |
|
Returns the settings value with a defaultValueOverride and with an optional dynamicKeyPart |
- class qgis.core.QgsSettingsEntryBaseTemplateQVariantMapBase¶
Bases:
QgsSettingsEntryBase
- __init__(name: str | None, parent: QgsSettingsTreeNode | None, defaultValue: Any, description: str | None = '', options: Qgis.SettingsOptions | Qgis.SettingsOption = Qgis.SettingsOptions())
Constructor for
QgsSettingsEntryByReference
.- Parameters:
name (Optional[str]) – specifies the key of the settings.
parent (Optional[QgsSettingsTreeNode]) – specifies the parent in the tree of settings.
defaultValue (Any) – specifies the default value for the settings entry.
description (Optional[str] = '') – specifies a description for the settings entry.
options (Union[Qgis.SettingsOptions, Qgis.SettingsOption] = Qgis.SettingsOptions()) – specifies the options for the settings entry.
- Raises:
QgsSettingsException – if the number of given parent named items doesn’t match the complete key definition
Added in version 3.30.
- __init__(key: str | None, section: str | None, defaultValue: Any, description: str | None = '', options: Qgis.SettingsOptions | Qgis.SettingsOption = Qgis.SettingsOptions())
Constructor for
QgsSettingsEntryByReference
.- Parameters:
key (Optional[str]) – specifies the key of the settings.
section (Optional[str]) – specifies the section.
defaultValue (Any) – specifies the default value for the settings entry.
description (Optional[str] = '') – specifies a description for the settings entry.
options (Union[Qgis.SettingsOptions, Qgis.SettingsOption] = Qgis.SettingsOptions()) – specifies the options for the settings entry.
- __init__(a0: QgsSettingsEntryBaseTemplateQVariantMapBase)
- Parameters:
- checkValuePrivate(self, value: Dict[str, Any]) bool ¶
Check if the value is valid
- Parameters:
value (Dict[str, Any])
- Return type:
bool
- convertFromVariant(self, value: Any) Dict[str, Any] ¶
Converts the variant value to the value type of the setting
- Parameters:
value (Any)
- Return type:
Dict[str, Any]
- convertToVariant(self, value: Dict[str, Any]) Any ¶
Converts the value to a variant
- Parameters:
value (Dict[str, Any])
- Return type:
Any
- defaultValue(self) Dict[str, Any] ¶
Returns settings default value.
- Return type:
Dict[str, Any]
- formerValue(self, dynamicKeyPart: str | None = '') Dict[str, Any] ¶
Returns the former value. Returns the current value (or default) if there is no former value.
- Parameters:
dynamicKeyPart (Optional[str] = '')
- Return type:
Dict[str, Any]
- formerValue(self, dynamicKeyPartList: Iterable[str | None]) Dict[str, Any]
Returns the former value Returns the current value (or default) if there is no former value.
- Parameters:
dynamicKeyPartList (Iterable[Optional[str]])
- Return type:
Dict[str, Any]
- setValue(self, value: Dict[str, Any], dynamicKeyPart: str | None = '') bool ¶
Set settings value.
- Parameters:
value (Dict[str, Any]) – specifies the value to set.
dynamicKeyPart (Optional[str] = '') – specifies the dynamic part of the settings key.
- Return type:
bool
- setValue(self, value: Dict[str, Any], dynamicKeyPartList: Iterable[str | None]) bool
Set settings value.
- Parameters:
value (Dict[str, Any]) – specifies the value to set.
dynamicKeyPartList (Iterable[Optional[str]]) – specifies the list of dynamic parts of the settings key.
- Return type:
bool
- setValuePrivate(self, value: Dict[str, Any], dynamicKeyPartList: Iterable[str | None]) bool ¶
Sets the settings value with an optional list of dynamic parts
- Parameters:
value (Dict[str, Any])
dynamicKeyPartList (Iterable[Optional[str]])
- Return type:
bool
- value(self, dynamicKeyPart: str | None = '') Dict[str, Any] ¶
Returns settings value.
- Parameters:
dynamicKeyPart (Optional[str] = '') – specifies the dynamic part of the settings key.
- Return type:
Dict[str, Any]
- value(self, dynamicKeyPartList: Iterable[str | None]) Dict[str, Any]
Returns settings value.
- Parameters:
dynamicKeyPartList (Iterable[Optional[str]]) – specifies the list of dynamic parts of the settings key.
- Return type:
Dict[str, Any]
- valueWithDefaultOverride(self, defaultValueOverride: Dict[str, Any], dynamicKeyPart: str | None = '') Dict[str, Any] ¶
Returns the settings value with a
defaultValueOverride
and with an optionaldynamicKeyPart
- Parameters:
defaultValueOverride (Dict[str, Any])
dynamicKeyPart (Optional[str] = '')
- Return type:
Dict[str, Any]
- valueWithDefaultOverride(self, defaultValueOverride: Dict[str, Any], dynamicKeyPartList: Iterable[str | None]) Dict[str, Any]
Returns the settings value with a
defaultValueOverride
for thedynamicKeyPartList
- Parameters:
defaultValueOverride (Dict[str, Any])
dynamicKeyPartList (Iterable[Optional[str]])
- Return type:
Dict[str, Any]