Class: QgsDoubleValidator

class qgis.gui.QgsDoubleValidator(parent: QObject)

Bases: PyQt5.QtGui.QRegularExpressionValidator

Constructor for QgsDoubleValidator.

QgsDoubleValidator(expression: QRegularExpression, bottom: float, top: float, parent: QObject) Constructor for QgsDoubleValidator.

Parameters
  • bottom – the minimal range limit accepted by the validator

  • top – the maximal range limit accepted by the validator

QgsDoubleValidator(bottom: float, top: float, parent: QObject) Constructor for QgsDoubleValidator.

Parameters
  • bottom – the minimal range limit accepted by the validator

  • top – the maximal range limit accepted by the validator

QgsDoubleValidator(bottom: float, top: float, decimal: int, parent: QObject) Constructor for QgsDoubleValidator.

Parameters
  • bottom – the minimal range limit accepted by the validator

  • top – the maximal range limit accepted by the validator

  • decimal – the number of decimal accepted by the validator

QgsDoubleValidator is a QLineEdit Validator that combines QDoubleValidator and QRegularExpressionValidator to allow user to enter double with both local and C interpretation as a fallback.

New in version 3.14.

Parameters

parent

bottom(self) → float

Returns top range limit

See also

setBottom()

Return type

float

childEvent(self, QChildEvent)
connectNotify(self, QMetaMethod)
customEvent(self, QEvent)
disconnectNotify(self, QMetaMethod)
isSignalConnected(self, QMetaMethod) → bool
receivers(self, PYQT_SIGNAL) → int
sender(self) → QObject
senderSignalIndex(self) → int
setBottom(self, bottom: float)

Set top range limit

See also

setTop()

See also

setRange()

Parameters

bottom (float) –

setRange(self, bottom: float, top: float)

Set bottom and top range limits

See also

setBottom()

See also

setTop()

Parameters
  • bottom (float) –

  • top (float) –

setTop(self, top: float)

Set top range limit

See also

setBottom()

See also

setRange()

Parameters

top (float) –

timerEvent(self, QTimerEvent)
toDouble(input: str) → float

Converts input string to double value. It used locale interpretation first and C locale interpretation as fallback

Parameters

input (str) –

Return type

float

top(self) → float

Returns top range limit

See also

setTop()

Return type

float

validate(self, input: str) → QValidator.State

Evaluates input string validity according to QRegularExpression and ability to be converted in double value.

Parameters

input (str) –

Return type

QValidator.State