Class: QgsSettingsEntryByReferenceQVariantMapBase¶
- class qgis.core.QgsSettingsEntryByReferenceQVariantMapBase¶
Bases:
QgsSettingsEntryBase
Base abstract class for settings entry which are passed by reference
See also
See also
QgsSettingsEntryByValue
New in version 3.26.
QgsSettingsEntryByReferenceQVariantMapBase(name: str, parent:
QgsSettingsTreeNode
, defaultValue: Dict[str, Any], description: str = ‘’, options: Union[Qgis.SettingsOptions, Qgis.SettingsOption] = Qgis.SettingsOptions()) Constructor for QgsSettingsEntryByReference.- Parameters
name – specifies the key of the settings.
parent – specifies the parent in the tree of settings.
defaultValue – specifies the default value for the settings entry.
description – specifies a description for the settings entry.
options – specifies the options for the settings entry.
- Raises
QgsSettingsException – if the number of given parent named items doesn’t match the complete key definition
New in version 3.30.
QgsSettingsEntryByReferenceQVariantMapBase(key: str, section: str, defaultValue: Dict[str, Any], description: str = ‘’, options: Union[Qgis.SettingsOptions, Qgis.SettingsOption] = Qgis.SettingsOptions()) Constructor for QgsSettingsEntryByReference.
- Parameters
key – specifies the key of the settings.
section – specifies the section.
defaultValue – specifies the default value for the settings entry.
description – specifies a description for the settings entry.
options – specifies the options for the settings entry.
QgsSettingsEntryByReferenceQVariantMapBase(
QgsSettingsEntryByReferenceQVariantMapBase
)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
Sets the settings value with a variant value.
- rtype
Qgis.SettingsType
Returns settings value.
Returns the settings value with a
defaultValueOverride
and with an optionaldynamicKeyPart
- checkValue(self, value: Dict[str, Any]) bool ¶
Check if the value is valid
- Parameters
value (Dict[str) –
- 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) –
- Return type
Any
- defaultValue(self) Dict[str, Any] ¶
Returns settings default value.
- Return type
Dict[str, Any]
- formerValue(self, dynamicKeyPart: str = '') Dict[str, Any] ¶
Returns the former value. Returns the current value (or default) if there is no former value.
formerValue(self, dynamicKeyPartList: Iterable[str]) -> Dict[str, Any] Returns the former value Returns the current value (or default) if there is no former value.
- Parameters
dynamicKeyPart (str = '') –
- Return type
Dict[str, Any]
- setValue(self, value: Dict[str, Any], dynamicKeyPart: str = '') bool ¶
Set settings value.
- Parameters
value (Dict[str) – specifies the value to set.
dynamicKeyPart (str = '') – specifies the dynamic part of the settings key.
setValue(self, value: Dict[str, Any], dynamicKeyPartList: Iterable[str]) -> bool Set settings value.
- Parameters
value – specifies the value to set.
dynamicKeyPartList – specifies the list of dynamic parts of the settings key.
- Return type
bool
- setValuePrivate(self, value: Dict[str, Any], dynamicKeyPartList: Iterable[str]) bool ¶
Sets the settings value with an optional list of dynamic parts
- Parameters
value (Dict[str) –
dynamicKeyPartList (Iterable[str]) –
- Return type
bool
- setVariantValuePrivate(self, value: Any, dynamicKeyPartList: Iterable[str] = []) bool ¶
Sets the settings value with a variant value. This should be called from any implementation as it takes care of actually calling QSettings
New in version 3.26.
- settingsType(self) Qgis.SettingsType ¶
- Return type
- value(self, dynamicKeyPart: str = '') Dict[str, Any] ¶
Returns settings value.
- Parameters
dynamicKeyPart (str = '') – specifies the dynamic part of the settings key.
value(self, dynamicKeyPartList: Iterable[str]) -> Dict[str, Any] Returns settings value.
- Parameters
dynamicKeyPartList – specifies the list of dynamic parts of the settings key.
value(self, dynamicKeyPart: str, useDefaultValueOverride: bool, defaultValueOverride: Dict[str, Any]) -> Dict[str, Any] Returns the settings value for the
dynamicKeyPart
and with adefaultValueOverride
Deprecated since version QGIS: 3.26 use valueAsVariantWithDefaultOverride instead
value(self, dynamicKeyPartList: Iterable[str], useDefaultValueOverride: bool, defaultValueOverride: Dict[str, Any]) -> Dict[str, Any] Returns the settings value for the
dynamicKeyPartList
and with adefaultValueOverride
Deprecated since version QGIS: 3.26 use valueAsVariantWithDefaultOverride instead
- Return type
Dict[str, Any]
- valueWithDefaultOverride(self, defaultValueOverride: Dict[str, Any], dynamicKeyPart: str = '') Dict[str, Any] ¶
Returns the settings value with a
defaultValueOverride
and with an optionaldynamicKeyPart
valueWithDefaultOverride(self, defaultValueOverride: Dict[str, Any], dynamicKeyPartList: Iterable[str]) -> Dict[str, Any] Returns the settings value with a
defaultValueOverride
for thedynamicKeyPartList
- Parameters
defaultValueOverride (Dict[str) –
dynamicKeyPart (str = '') –
- Return type
Dict[str, Any]