Class: QgsDoubleValidator¶
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.
Added in version 3.14.
Class Hierarchy¶
Base classes¶
Methods
Returns top range limit |
|
Set top range limit |
|
Sets the number of decimals accepted by the validator to maxDecimals. |
|
Set bottom and top range limits |
|
Set top range limit |
|
Returns top range limit |
|
Evaluates input string validity according to QRegularExpression and ability to be converted in double value. |
Static Methods
Converts input string to double value. |
- class qgis.gui.QgsDoubleValidator[source]¶
Bases:
QRegularExpressionValidator
- __init__(parent: QObject | None)
Constructor for QgsDoubleValidator.
- Parameters:
parent (Optional[QObject])
- __init__(expression: QRegularExpression, bottom: float, top: float, parent: QObject | None)
Constructor for QgsDoubleValidator.
- Parameters:
bottom (float) – the minimal range limit accepted by the validator
top (float) – the maximal range limit accepted by the validator
parent (Optional[QObject]) – parent object
expression (QRegularExpression) – custom regular expression
- __init__(bottom: float, top: float, parent: QObject | None)
Constructor for QgsDoubleValidator.
- Parameters:
bottom (float) – the minimal range limit accepted by the validator
top (float) – the maximal range limit accepted by the validator
parent (Optional[QObject]) – parent object
- __init__(bottom: float, top: float, decimal: int, parent: QObject | None)
Constructor for QgsDoubleValidator.
- Parameters:
bottom (float) – the minimal range limit accepted by the validator
top (float) – the maximal range limit accepted by the validator
decimal (int) – the number of decimals accepted by the validator
parent (Optional[QObject]) – parent object
- __init__(decimal: int, parent: QObject | None)
Constructor for QgsDoubleValidator.
- Parameters:
decimal (int) – the number of decimals accepted by the validator
parent (Optional[QObject]) – parent object
Added in version 3.16.
- setBottom(self, bottom: float)[source]¶
Set top range limit
See also
See also
- Parameters:
bottom (float)
- setMaxDecimals(self, maxDecimals: int)[source]¶
Sets the number of decimals accepted by the validator to
maxDecimals
.Warning
setting decimals overrides any custom regular expression that was previously set
Added in version 3.22.
- Parameters:
maxDecimals (int)
- setRange(self, bottom: float, top: float)[source]¶
Set bottom and top range limits
See also
See also
- Parameters:
bottom (float)
top (float)