Details
-
Bug
-
Resolution: Fixed
-
P2: Important
-
None
-
5.14.1
-
None
Description
Using QDoubleValidator on german system leads to unexpected results on validate(). It seems that thousand-seperator is forced to be present. If not present input is handled as Invalid.
QDoubleValidator validator; validator.setNotation( QDoubleValidator::StandardNotation); int pos; QString str("-0.3"); QValidator::State valid; validator.setLocale( QLocale::C); validator.setRange(-3.0, 0.0); valid = validator.validate( str, pos); // returns Invalid validator.setRange(-2.99, 0.0); valid = validator.validate( str, pos); // returns Invalid validator.setLocale( QLocale::German); validator.setRange(-3.0, 0.0); valid = validator.validate( str, pos); // returns Acceptable (str converted to -3 ?) validator.setRange(-2.99, 0.0); valid = validator.validate( str, pos); // returns Intermediate str = "-0,3"; validator.setLocale( QLocale::C); validator.setRange(-3.0, 0.0); valid = validator.validate( str, pos); // returns Acceptable (str converted to -3 ?) validator.setRange(-2.99, 0.0); valid = validator.validate( str, pos); // returns Intermediate validator.setLocale( QLocale::German); validator.setRange(-3.0, 0.0); valid = validator.validate( str, pos); // returns Invalid validator.setRange(-2.99, 0.0); valid = validator.validate( str, pos); // returns Invalid
Attachments
Issue Links
- relates to
-
QTBUG-71914 QDoubleValidator::validate Accepts Numbers with Misaligned Separator Characters
- Closed