Class: QgsSettingsEntryByReferenceQVariantBase¶
- class qgis.core.QgsSettingsEntryByReferenceQVariantBase¶
Bases:
QgsSettingsEntryBase
Base abstract class for settings entry which are passed by reference
See also
See also
QgsSettingsEntryByValue
New in version 3.26.
QgsSettingsEntryByReferenceQVariantBase(key: str, section: str, defaultValue: Any, description: str = ‘’, options: Union[Qgis.SettingsOptions, Qgis.SettingsOption] = Qgis.SettingsOptions()) Constructor for QgsSettingsEntryByReference.
The
key
argument specifies the key of the settings. ThedefaultValue
argument specifies the default value for the settings entry. Thedescription
argument specifies a description for the settings entry. Theoptions
arguments specifies the options for the settings entry.QgsSettingsEntryByReferenceQVariantBase(
QgsSettingsEntryByReferenceQVariantBase
)Methods
Check if the value is valid
Converts the variant value to the value type of the setting
Converts the value to a variant
Returns settings default value.
Returns the former value.
Set settings value.
Sets the settings value with an optional list of dynamic parts
Sets the settings value with a variant value.
- rtype:
Qgis.SettingsType
Returns settings value.
Returns the settings value with a
defaultValueOverride
and with an optionaldynamicKeyPart
- checkValue(self, value: Any) bool ¶
Check if the value is valid
- Parameters:
value (Any) –
- Return type:
bool
- convertFromVariant(self, value: Any) Any ¶
Converts the variant value to the value type of the setting
- Parameters:
value (Any) –
- Return type:
Any
- convertToVariant(self, value: Any) Any ¶
Converts the value to a variant
- Parameters:
value (Any) –
- Return type:
Any
- defaultValue(self) Any ¶
Returns settings default value.
- Return type:
Any
- formerValue(self, dynamicKeyPart: str = '') Any ¶
Returns the former value. Returns the current value (or default) if there is no former value.
formerValue(self, dynamicKeyPartList: Iterable[str]) -> Any Returns the former value Returns the current value (or default) if there is no former value.
- Parameters:
dynamicKeyPart (str = '') –
- Return type:
Any
- setValue(self, value: Any, dynamicKeyPart: str = '') bool ¶
Set settings value.
The
value
to set. ThedynamicKeyPart
argument specifies the dynamic part of the settings key.setValue(self, value: Any, dynamicKeyPartList: Iterable[str]) -> bool Set settings value.
The
value
to set. ThedynamicKeyParts
argument specifies the list of dynamic parts of the settings key.- Parameters:
value (Any) –
dynamicKeyPart (str = '') –
- Return type:
bool
- setValuePrivate(self, value: Any, dynamicKeyPartList: Iterable[str]) bool ¶
Sets the settings value with an optional list of dynamic parts
- Parameters:
value (Any) –
dynamicKeyPartList (Iterable[str]) –
- Return type:
bool
- 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:
- value(self, dynamicKeyPart: str = '') Any ¶
Returns settings value.
The
dynamicKeyPart
argument specifies the dynamic part of the settings key. ThedefaultValueOverride
argument if valid is used instead of the normal default value.value(self, dynamicKeyPartList: Iterable[str]) -> Any Returns settings value.
The
dynamicKeyPartList
argument specifies the list of dynamic parts of the settings key. ThedefaultValueOverride
argument if valid is used instead of the normal default value.value(self, dynamicKeyPart: str, useDefaultValueOverride: bool, defaultValueOverride: Any) -> Any Returns the settings value for the
dynamicKeyPart
and with adefaultValueOverride
Deprecated since version QGIS: 3.26 use valueAsVariantWithDefaultOverride instead
value(self, dynamicKeyPartList: Iterable[str], useDefaultValueOverride: bool, defaultValueOverride: Any) -> Any Returns the settings value for the
dynamicKeyPartList
and with adefaultValueOverride
Deprecated since version QGIS: 3.26 use valueAsVariantWithDefaultOverride instead
- Parameters:
dynamicKeyPart (str = '') –
- Return type:
Any
- valueWithDefaultOverride(self, defaultValueOverride: Any, dynamicKeyPart: str = '') Any ¶
Returns the settings value with a
defaultValueOverride
and with an optionaldynamicKeyPart
valueWithDefaultOverride(self, defaultValueOverride: Any, dynamicKeyPartList: Iterable[str]) -> Any Returns the settings value with a
defaultValueOverride
for thedynamicKeyPartList
- Parameters:
defaultValueOverride (Any) –
dynamicKeyPart (str = '') –
- Return type:
Any