Class: QgsSettingsEntryVariant¶
- class qgis.core.QgsSettingsEntryVariant¶
Bases:
QgsSettingsEntryBaseTemplateQVariantBase
A variant settings entry.
Added in version 3.20.
QgsSettingsEntryVariant(name: Optional[str], parent: Optional[QgsSettingsTreeNode], defaultValue: Any = None, description: Optional[str] = ‘’, options: Union[Qgis.SettingsOptions, Qgis.SettingsOption] = Qgis.SettingsOptions()) Constructor for QgsSettingsEntryVariant.
- Parameters:
name – specifies the name of the setting.
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.
Added in version 3.30.
QgsSettingsEntryVariant(key: Optional[str], pluginName: Optional[str], defaultValue: Any = None, description: Optional[str] = ‘’, options: Union[Qgis.SettingsOptions, Qgis.SettingsOption] = Qgis.SettingsOptions()) Constructor for QgsSettingsEntryVariant. This constructor is intended to be used from plugins.
- Parameters:
key – specifies the key of the settings.
pluginName – is inserted in the key after 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.
QgsSettingsEntryVariant(a0:
QgsSettingsEntryVariant
)Methods
Check if the value is valid
- param value:
Converts the value to a variant
Sets the settings value with an optional list of dynamic parts
- rtype:
Qgis.SettingsType
Returns settings value.
- checkValuePrivate(self, value: Any) bool ¶
Check if the value is valid
- convertFromVariant(self, value: Any) Any ¶
- Parameters:
value (Any)
- Return type:
Any
- convertToVariant(self, value: Any) Any ¶
Converts the value to a variant
- setValuePrivate(self, value: Any, dynamicKeyPartList: Iterable[str | None]) bool ¶
Sets the settings value with an optional list of dynamic parts
- settingsType(self) Qgis.SettingsType ¶
- Return type:
- valueAs(self, type: Any) Any ¶
Returns settings value.
- Parameters:
type (Any) – is the Python type of the value to be returned
- Return type:
Any