`DoubleValidatorStrict` verifies additional condition: double number can not contain commas, since it can't be converted to floating point number directly.
| 435 | |
| 436 | |
| 437 | class DoubleValidatorStrict(DoubleValidator): |
| 438 | """ |
| 439 | `DoubleValidatorStrict` verifies additional condition: double number can not |
| 440 | contain commas, since it can't be converted to floating point number directly. |
| 441 | """ |
| 442 | |
| 443 | def validate(self, text, pos): |
| 444 | result = super().validate(text, pos) |
| 445 | # Additional condition: the number can not contain ",". For some reason |
| 446 | # the standard validators ignore commas at the end of the number. |
| 447 | if "," in text[pos:]: |
| 448 | result = (QDoubleValidator.Invalid, result[1], result[2]) |
| 449 | return result |
| 450 | |
| 451 | |
| 452 | class DoubleValidatorRelaxed(DoubleValidatorStrict): |