Class: QgsSettingsEntryVariant

class qgis.core.QgsSettingsEntryVariant

Bases: QgsSettingsEntryBase

A variant settings entry.

New in version 3.20.

QgsSettingsEntryVariant(key: str, pluginName: str, defaultValue: Any = None, description: str = ‘’) Constructor for QgsSettingsEntryVariant. This constructor is intended to be used from plugins.

The key argument specifies the key of the settings. The pluginName argument is inserted in the key after the section. The default value argument specifies the default value for the settings entry. The description argument specifies a description for the settings entry.

QgsSettingsEntryVariant(QgsSettingsEntryVariant)

Methods

defaultValue

Get settings default value.

setValue

Set settings value.

settingsType

copydoc QgsSettingsEntryBase.settingsType

value

Get settings value.

defaultValue(self)Any

Get settings default value.

Return type

Any

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

Set settings value.

The value to set. The dynamicKeyPart argument specifies the dynamic part of the settings key.

setValue(self, value: Any, dynamicKeyPartList: Iterable[str]) -> bool Set settings value.

The value to set. The dynamicKeyParts argument specifies the list of dynamic parts of the settings key.

Parameters
  • value (Any) –

  • dynamicKeyPart (str = '') –

Return type

bool

settingsType(self)QgsSettingsEntryBase.SettingsType

copydoc QgsSettingsEntryBase.settingsType

Return type

QgsSettingsEntryBase.SettingsType

value(self, dynamicKeyPart: str = '', useDefaultValueOverride: bool = False, defaultValueOverride: Any = None)Any

Get settings value.

The dynamicKeyPart argument specifies the dynamic part of the settings key. The useDefaultValueOverride argument specifies if defaultValueOverride should be used. The defaultValueOverride argument if valid is used instead of the normal default value.

value(self, dynamicKeyPartList: Iterable[str], useDefaultValueOverride: bool = False, defaultValueOverride: Any = None) -> Any Get settings value.

The dynamicKeyParts argument specifies the list of dynamic parts of the settings key. The useDefaultValueOverride argument specifies if defaultValueOverride should be used. The defaultValueOverride argument if valid is used instead of the normal default value.

Parameters
  • dynamicKeyPart (str = '') –

  • useDefaultValueOverride (bool = False) –

  • defaultValueOverride (Any = None) –

Return type

Any