An input text validator that accepts decimal notation, engineering/scientific notation (e.g.
More...
|
| | __init__ (self, parent=None) |
| | Initialise the FloatingPointValidator object.
|
| |
| | validate (self, str input, int pos) |
| | Check that the input string conforms to a valid or plausible floating-point value.
|
| |
| | fixup (self, str input) |
| | Adjusts the input string to the nearest likely valid floating-point value.
|
| |
| | get_minimum (self) |
| | Getter returns the minimum value accepted by the validator.
|
| |
| | set_minimum (self, float value) |
| | Setter for the minimum value accepted by the validator.
|
| |
| | get_maximum (self) |
| | Getter returns the maximum value accepted by the validator.
|
| |
| | set_maximum (self, float value) |
| | Setter for the maximum value accepted by the validator.
|
| |
An input text validator that accepts decimal notation, engineering/scientific notation (e.g.
1.25e6), positive and negative infinity and NaN values for floating-point number validation.
◆ __init__()
| gui.float_edit.FloatingPointValidator.__init__ |
( |
| self, |
|
|
| parent = None ) |
Initialise the FloatingPointValidator object.
- Parameters
-
| parent | The optional parent Qt object of the new instance. |
◆ fixup()
| gui.float_edit.FloatingPointValidator.fixup |
( |
| self, |
|
|
str | input ) |
Adjusts the input string to the nearest likely valid floating-point value.
- Parameters
-
| input | The input string to adjust. |
- Returns
- Corrected valid value as a string or the original if it was already valid.
◆ get_maximum()
| gui.float_edit.FloatingPointValidator.get_maximum |
( |
| self | ) |
|
Getter returns the maximum value accepted by the validator.
All values below and including the maximum are accepted as valid.
◆ get_minimum()
| gui.float_edit.FloatingPointValidator.get_minimum |
( |
| self | ) |
|
Getter returns the minimum value accepted by the validator.
All values above and including the minimum are accepted as valid.
◆ set_maximum()
| gui.float_edit.FloatingPointValidator.set_maximum |
( |
| self, |
|
|
float | value ) |
Setter for the maximum value accepted by the validator.
All values below and including the maximum are accepted as valid.
- Parameters
-
| value | The new maximum value allowed. |
◆ set_minimum()
| gui.float_edit.FloatingPointValidator.set_minimum |
( |
| self, |
|
|
float | value ) |
Setter for the minimum value accepted by the validator.
All values above and including the minimum are accepted as valid.
- Parameters
-
| value | The new minimum value allowed. |
◆ validate()
| gui.float_edit.FloatingPointValidator.validate |
( |
| self, |
|
|
str | input, |
|
|
int | pos ) |
Check that the input string conforms to a valid or plausible floating-point value.
There is also a bounds check that will check that the value falls between the minimum and maximum (inclusive) set for the validator. Note that infinities are not checked against the minimum and maximum on purpose, i.e. "inf" is always accepted as valid, irrespective of the value for maximum.
- Parameters
-
| input | The input string to check. |
| pos | The position of the cursor within the input string. |
- Returns
- Tuple containing the validity flag, the input and pos arguments.
◆ _maximum
| gui.float_edit.FloatingPointValidator._maximum = 3.4028234e38 |
|
protected |
◆ _minimum
| gui.float_edit.FloatingPointValidator._minimum = -3.4028234e38 |
|
protected |
◆ maximum
| gui.float_edit.FloatingPointValidator.maximum |
|
static |
Initial value:= Property(
type=float,
fget=get_maximum,
fset=set_maximum,
doc="The maximum value allowed.",
)
◆ minimum
| gui.float_edit.FloatingPointValidator.minimum |
|
static |
Initial value:= Property(
type=float,
fget=get_minimum,
fset=set_minimum,
doc="The minimum value allowed.",
)
The documentation for this class was generated from the following file: