Class: QgsSettingsEntryString¶
- class qgis.core.QgsSettingsEntryString¶
Bases:
QgsSettingsEntryBaseTemplateQStringBase
A string settings entry.
New in version 3.20.
QgsSettingsEntryString(name: str, parent:
QgsSettingsTreeNode
, defaultValue: str = ‘’, description: str = ‘’, options: Union[Qgis.SettingsOptions, Qgis.SettingsOption] = Qgis.SettingsOptions(), minLength: int = 0, maxLength: int = -1) Constructor for QgsSettingsEntryString.- 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.
minLength – specifies the minimal length of the string value. 0 means no limit.
maxLength – specifies the maximal length of the string value. -1 means no limit.
QgsSettingsEntryString(key: str, pluginName: str, defaultValue: str = ‘’, description: str = ‘’, options: Union[Qgis.SettingsOptions, Qgis.SettingsOption] = Qgis.SettingsOptions(), minLength: int = 0, maxLength: int = -1) Constructor for QgsSettingsEntryString. 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.
QgsSettingsEntryString(
QgsSettingsEntryString
)Methods
Check if the value is valid
- param value:
Converts the value to a variant
Returns the string maximum length.
Returns the string minimum length.
Sets the settings value with an optional list of dynamic parts
- rtype:
Qgis.SettingsType
- checkValuePrivate(self, value: str) bool ¶
Check if the value is valid
- convertFromVariant(self, value: Any) str ¶
- Parameters:
value (Any) –
- Return type:
str
- convertToVariant(self, value: str) Any ¶
Converts the value to a variant
- 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
- setValuePrivate(self, value: str, dynamicKeyPartList: Iterable[str]) bool ¶
Sets the settings value with an optional list of dynamic parts
- settingsType(self) Qgis.SettingsType ¶
- Return type: