Class: QgsSettingsEntryBaseTemplateboolBase

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

Added in version 3.32.

Class Hierarchy

Inheritance diagram of qgis.core.QgsSettingsEntryBaseTemplateboolBase

Base classes

QgsSettingsEntryBase

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

Subclasses

QgsSettingsEntryBool

A boolean settings entry.

class qgis.core.QgsSettingsEntryBaseTemplateboolBase

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: QgsSettingsEntryBaseTemplateboolBase)
Parameters:

a0 (QgsSettingsEntryBaseTemplateboolBase)

checkValuePrivate(self, value: bool) bool

Check if the value is valid

Parameters:

value (bool)

Return type:

bool

convertFromVariant(self, value: Any) bool

Converts the variant value to the value type of the setting

Parameters:

value (Any)

Return type:

bool

convertToVariant(self, value: bool) Any

Converts the value to a variant

Parameters:

value (bool)

Return type:

Any

defaultValue(self) bool

Returns settings default value.

Return type:

bool

formerValue(self, dynamicKeyPart: str | None = '') bool

Returns the former value. Returns the current value (or default) if there is no former value.

formerValue(self, dynamicKeyPartList: Iterable[Optional[str]]) -> bool Returns the former value Returns the current value (or default) if there is no former value.

Parameters:

dynamicKeyPart (Optional[str] = '')

Return type:

bool

setValue(self, value: bool, dynamicKeyPart: str | None = '') bool

Set settings value.

Parameters:
  • value (bool) – specifies the value to set.

  • dynamicKeyPart (Optional[str] = '') – specifies the dynamic part of the settings key.

setValue(self, value: bool, 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: bool, dynamicKeyPartList: Iterable[str | None]) bool

Sets the settings value with an optional list of dynamic parts

Parameters:
  • value (bool)

  • dynamicKeyPartList (Iterable[Optional[str]])

Return type:

bool

value(self, dynamicKeyPart: str | None = '') bool

Returns settings value.

Parameters:

dynamicKeyPart (Optional[str] = '') – specifies the dynamic part of the settings key.

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

Parameters:

dynamicKeyPartList – specifies the list of dynamic parts of the settings key.

Return type:

bool

valueWithDefaultOverride(self, defaultValueOverride: bool, dynamicKeyPart: str | None = '') bool

Returns the settings value with a defaultValueOverride and with an optional dynamicKeyPart

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

Parameters:
  • defaultValueOverride (bool)

  • dynamicKeyPart (Optional[str] = '')

Return type:

bool