Class: QgsSettingsEntryBaseTemplateQVariantMapBase

Base abstract class for settings entries with typed get and set methods.

Added in version 3.32.

Class Hierarchy

Inheritance diagram of qgis.core.QgsSettingsEntryBaseTemplateQVariantMapBase

Base classes

QgsSettingsEntryBase

Represents a settings entry and provides methods for reading and writing settings values.

Subclasses

QgsSettingsEntryVariantMap

A string list settings entry.

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:

a0 (QgsSettingsEntryBaseTemplateQVariantMapBase)

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.

formerValue(self, dynamicKeyPartList: Iterable[Optional[str]]) -> 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]

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.

setValue(self, value: Dict[str, Any], dynamicKeyPartList: Iterable[Optional[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 | 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.

value(self, dynamicKeyPartList: Iterable[Optional[str]]) -> Dict[str, Any] Returns settings value.

Parameters:

dynamicKeyPartList – 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 optional dynamicKeyPart

valueWithDefaultOverride(self, defaultValueOverride: Dict[str, Any], dynamicKeyPartList: Iterable[Optional[str]]) -> Dict[str, Any] Returns the settings value with a defaultValueOverride for the dynamicKeyPartList

Parameters:
  • defaultValueOverride (Dict[str, Any])

  • dynamicKeyPart (Optional[str] = '')

Return type:

Dict[str, Any]