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 decimals accepted by the validator
parent – parent object
QgsDoubleValidator(decimal: int, parent: QObject) Constructor for QgsDoubleValidator.
- Parameters
decimal – the number of decimals accepted by the validator
parent – parent object
New in version 3.16.
QgsDoubleValidator
is a QLineEdit Validator that combines QDoubleValidator and QRegularExpressionValidator to allow users to enter doubles with both local and C interpretation as a fallback.New in version 3.14:
Methods
Returns top range limit
Set top range limit
Set bottom and top range limits
Set top range limit
Converts
input
string to double value.Returns top range limit
Evaluates
input
string validity according to QRegularExpression and ability to be converted in double value.- bottom(self) float ¶
Returns top range limit
See also
- 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
See also
- Parameters
bottom (float) –
- setRange(self, bottom: float, top: float)¶
Set bottom and top range limits
See also
See also
- Parameters
bottom (float) –
top (float) –
- setTop(self, top: float)¶
Set top range limit
See also
See also
- 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
- 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