Class: QgsSettingsEntryVariant

class qgis.core.QgsSettingsEntryVariant

Bases: QgsSettingsEntryByReferenceQVariantBase

A variant settings entry.

New in version 3.20.

QgsSettingsEntryVariant(key: str, pluginName: str, defaultValue: Any = None, description: str = ‘’, options: Union[Qgis.SettingsOptions, Qgis.SettingsOption] = Qgis.SettingsOptions()) 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 defaultValue argument specifies the default value for the settings entry. The description argument specifies a description for the settings entry. The options arguments specifies the options for the settings entry.

QgsSettingsEntryVariant(QgsSettingsEntryVariant)

Methods

checkValue

Check if the value is valid

convertFromVariant

Converts the variant value to the value type of the setting

convertToVariant

Converts the value to a variant

setValuePrivate

Sets the settings value with an optional list of dynamic parts

setVariantValuePrivate

Sets the settings value with a variant value.

settingsType

rtype:

Qgis.SettingsType

checkValue(self, value: Any) bool

Check if the value is valid

convertFromVariant(self, value: Any) Any

Converts the variant value to the value type of the setting

convertToVariant(self, value: Any) Any

Converts the value to a variant

setValuePrivate(self, value: Any, dynamicKeyPartList: Iterable[str]) bool

Sets the settings value with an optional list of dynamic parts

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:

Qgis.SettingsType