Class: QgsSettingsEntryDouble¶
- class qgis.core.QgsSettingsEntryDouble¶
Bases:
QgsSettingsEntryBaseTemplatedoubleBase
A double settings entry.
New in version 3.20.
QgsSettingsEntryDouble(name: str, parent:
QgsSettingsTreeNode
, defaultValue: float = 0, description: str = ‘’, options: Union[Qgis.SettingsOptions, Qgis.SettingsOption] = Qgis.SettingsOptions(), minValue: float = -DBL_MAX, maxValue: float = DBL_MAX, displayDecimals: int = 1) Constructor for QgsSettingsEntryDouble.- 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.
minValue – specifies the minimal value.
maxValue – specifies the maximal value.
displayDecimals – specifies a hint for the gui about how much decimals to show for example for a QDoubleSpinBox.
QgsSettingsEntryDouble(key: str, pluginName: str, defaultValue: float, description: str = ‘’, options: Union[Qgis.SettingsOptions, Qgis.SettingsOption] = Qgis.SettingsOptions(), minValue: float = -DBL_MAX, maxValue: float = DBL_MAX, displayDecimals: int = 1) Constructor for QgsSettingsEntryDouble. This constructor is intended to be used from plugins.
- Parameters:
key – specifies the key of the settings.
pluginName – is used to define the key of the setting
defaultValue – specifies the default value for the settings entry.
options – specifies the options for the settings entry.
description – specifies a description for the settings entry.
minValue – specifies the minimal value.
maxValue – specifies the maximal value.
displayDecimals – specifies a hint for the gui about how much decimals to show
QgsSettingsEntryDouble(
QgsSettingsEntryDouble
)Methods
Check if the value is valid
- param value:
Converts the value to a variant
Returns how much decimals should be shown in the Gui.
Returns the maximum value.
Returns the minimum value.
Set the display hint decimals.
Sets the settings value with an optional list of dynamic parts
- rtype:
Qgis.SettingsType
- checkValuePrivate(self, value: float) bool ¶
Check if the value is valid
- convertFromVariant(self, value: Any) float ¶
- Parameters:
value (Any) –
- Return type:
float
- convertToVariant(self, value: float) Any ¶
Converts the value to a variant
- displayHintDecimals(self) int ¶
Returns how much decimals should be shown in the Gui.
- Return type:
int
- maxValue(self) float ¶
Returns the maximum value.
- Return type:
float
- minValue(self) float ¶
Returns the minimum value.
- Return type:
float
- setDisplayHintDecimals(self, displayHintDecimals: int)¶
Set the display hint decimals.
displayHintDecimals The number of decimals that should be shown in the Gui.
- Parameters:
displayHintDecimals (int) –
- setValuePrivate(self, value: float, dynamicKeyPartList: Iterable[str]) bool ¶
Sets the settings value with an optional list of dynamic parts
- settingsType(self) Qgis.SettingsType ¶
- Return type: