Class: QgsSettingsEntryDouble

A double settings entry.

Added in version 3.20.

Class Hierarchy

Inheritance diagram of qgis.core.QgsSettingsEntryDouble

Base classes

QgsSettingsEntryBaseTemplatedoubleBase

Base abstract class for settings entries with typed get and set methods.

QgsSettingsEntryBase

Represents a settings entry and provides methods for reading and writing settings values.

Methods

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.

class qgis.core.QgsSettingsEntryDouble[source]

Bases: QgsSettingsEntryBaseTemplatedoubleBase

__init__(name: str | None, parent: QgsSettingsTreeNode | None, defaultValue: float = 0, description: str | None = '', options: Qgis.SettingsOptions | Qgis.SettingsOption = Qgis.SettingsOptions(), minValue: float = -DBL_MAX, maxValue: float = DBL_MAX, displayDecimals: int = 1)

Constructor for QgsSettingsEntryDouble.

Parameters:
  • name (Optional[str]) – specifies the name of the setting.

  • parent (Optional[QgsSettingsTreeNode]) – specifies the parent in the tree of settings.

  • defaultValue (float = 0) – specifies the default value for the settings entry.

  • description (Optional[str] = '') – specifies a description for the settings entry.

  • options (Union[Qgis.SettingsOptions, Qgis.SettingsOption] = Qgis.SettingsOptions()) – specifies the options for the settings entry.

  • minValue (float = -DBL_MAX) – specifies the minimal value.

  • maxValue (float = DBL_MAX) – specifies the maximal value.

  • displayDecimals (int = 1) – specifies a hint for the gui about how much decimals to show for example for a QDoubleSpinBox.

__init__(key: str | None, pluginName: str | None, defaultValue: float, description: str | None = '', options: 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 (Optional[str]) – specifies the key of the settings.

  • pluginName (Optional[str]) – is used to define the key of the setting

  • defaultValue (float) – specifies the default value for the settings entry.

  • options (Union[Qgis.SettingsOptions, Qgis.SettingsOption] = Qgis.SettingsOptions()) – specifies the options for the settings entry.

  • description (Optional[str] = '') – specifies a description for the settings entry.

  • minValue (float = -DBL_MAX) – specifies the minimal value.

  • maxValue (float = DBL_MAX) – specifies the maximal value.

  • displayDecimals (int = 1) – specifies a hint for the gui about how much decimals to show

__init__(a0: QgsSettingsEntryDouble)
Parameters:

a0 (QgsSettingsEntryDouble)

displayHintDecimals(self) int[source]

Returns how much decimals should be shown in the Gui.

Return type:

int

maxValue(self) float[source]

Returns the maximum value.

Return type:

float

minValue(self) float[source]

Returns the minimum value.

Return type:

float

setDisplayHintDecimals(self, displayHintDecimals: int)[source]

Set the display hint decimals.

displayHintDecimals The number of decimals that should be shown in the Gui.

Parameters:

displayHintDecimals (int)