Class: QgsSettingsEntryDouble

class qgis.core.QgsSettingsEntryDouble

Bases: QgsSettingsEntryByValuedoubleBase

A double settings entry.

New in version 3.20.

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.

The key argument specifies the key of the settings. The pluginName argument is used to define the key of the setting The defaultValue argument specifies the default value for the settings entry. The options arguments specifies the options for the settings entry. The description argument specifies a description for the settings entry. The minValue argument specifies the minimal value. The maxValue argument specifies the maximal value. The displayDecimals specifies an hint for the gui about how much decimals to show

QgsSettingsEntryDouble(QgsSettingsEntryDouble)

Methods

checkValue

Check if the value is valid

convertFromVariant

Converts the variant value to the value type of the setting

convertToVariant

Converts the value to a variant

displayHintDecimals

Returns how much decimals should be shown in the Gui.

maxValue

Returns the maximum value.

minValue

Returns the minimum value.

setDisplayHintDecimals

Set the display hint decimals.

setMaxValue

Set the maximum value.

setMinValue

Set the minimum value.

setValuePrivate

Sets the settings value with an optional list of dynamic parts

setVariantValuePrivate

Sets the settings value with a variant value.

settingsType

rtype:

Qgis.SettingsType

checkValue(self, value: float) bool

Check if the value is valid

convertFromVariant(self, value: Any) float

Converts the variant value to the value type of the setting

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) –

setMaxValue(self, maxValue: float)

Set the maximum value.

maxValue The maximum value.

Parameters:

maxValue (float) –

setMinValue(self, minValue: float)

Set the minimum value.

minValue The minimum value.

Parameters:

minValue (float) –

setValuePrivate(self, value: float, dynamicKeyPartList: Iterable[str]) bool

Sets the settings value with an optional list of dynamic parts

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:

Qgis.SettingsType