diff options
author | Fabian Kosmale <fabian.kosmale@qt.io> | 2019-12-03 11:13:42 +0100 |
---|---|---|
committer | Fabian Kosmale <fabian.kosmale@qt.io> | 2019-12-05 11:30:24 +0100 |
commit | 3359b29c99581f52acf033489ad35884a01ccac8 (patch) | |
tree | 5b607ee0309f2de830fcf562a906dd762f29f249 /src | |
parent | 5a6fb46488ebc26b79b9d37a7f91969e0d852b4f (diff) |
QDoubleValidator: Fix thousand separator handling
QDoubleValidator would accept "1,23" as valid in a locale which has ','
as a thousand separator. However, it should have been Intermediate
instead, as there is still one digit missing.
Fixes: QTBUG-75110
Change-Id: I6de90f0b6f1eae95dc8dfc8e5f9658e482e46db3
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/util/qvalidator.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/util/qvalidator.cpp b/src/gui/util/qvalidator.cpp index 2237b016e9..54cbb28ffa 100644 --- a/src/gui/util/qvalidator.cpp +++ b/src/gui/util/qvalidator.cpp @@ -688,7 +688,7 @@ QValidator::State QDoubleValidatorPrivate::validateWithLocale(QString &input, QL return QValidator::Invalid; bool ok = false; - double i = buff.toDouble(&ok); // returns 0.0 if !ok + double i = locale.toDouble(input, &ok); // returns 0.0 if !ok if (i == qt_qnan()) return QValidator::Invalid; if (!ok) |