Class: QgsSettingsEntryString¶
- class qgis.core.QgsSettingsEntryString¶
Bases:
QgsSettingsEntryBase
A string settings entry.
New in version 3.20.
QgsSettingsEntryString(key: str, pluginName: str, defaultValue: str = ‘’, description: str = ‘’) Constructor for QgsSettingsEntryString. This constructor is intended to be used from plugins.
The
key
argument specifies the key of the settings. ThepluginName
argument is inserted in the key after the section. Thedefault
value argument specifies the default value for the settings entry. Thedescription
argument specifies a description for the settings entry.QgsSettingsEntryString(
QgsSettingsEntryString
)Methods
Get settings default value.
Returns the string maximum length.
Returns the string minimum length.
Set the string maximum length.
Set the string minimum length.
Set settings value.
copydoc
QgsSettingsEntryBase
.settingsTypeGet settings value.
- defaultValue(self) str ¶
Get settings default value.
- Return type
str
- maxLength(self) int ¶
Returns the string maximum length. By -1 there is no limitation.
- Return type
int
- minLength(self) int ¶
Returns the string minimum length.
- Return type
int
- setMaxLength(self, maxLength: int)¶
Set the string maximum length.
maxLength The string maximum length.
- Parameters
maxLength (int) –
- setMinLength(self, minLength: int)¶
Set the string minimum length.
minLength The string minimum length.
- Parameters
minLength (int) –
- setValue(self, value: str, dynamicKeyPart: str = '') bool ¶
Set settings value.
The
value
to set. ThedynamicKeyPart
argument specifies the dynamic part of the settings key.setValue(self, value: str, 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 (str) –
dynamicKeyPart (str = '') –
- Return type
bool
- settingsType(self) QgsSettingsEntryBase.SettingsType ¶
copydoc
QgsSettingsEntryBase
.settingsType- Return type
- value(self, dynamicKeyPart: str = '', useDefaultValueOverride: bool = False, defaultValueOverride: str = '') str ¶
Get settings value.
The
dynamicKeyPart
argument specifies the dynamic part of the settings key. TheuseDefaultValueOverride
argument specifies if defaultValueOverride should be used. ThedefaultValueOverride
argument if valid is used instead of the normal default value.value(self, dynamicKeyPartList: Iterable[str], useDefaultValueOverride: bool = False, defaultValueOverride: str = ‘’) -> str Get settings value.
The
dynamicKeyParts
argument specifies the list of dynamic parts of the settings key. TheuseDefaultValueOverride
argument specifies if defaultValueOverride should be used. ThedefaultValueOverride
argument if valid is used instead of the normal default value.- Parameters
dynamicKeyPart (str = '') –
useDefaultValueOverride (bool = False) –
defaultValueOverride (str = '') –
- Return type
str