From 10cb65fbf6e5bb8c393b399ae1367c8da2d595e3 Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Wed, 16 Sep 2020 16:29:54 +0200 Subject: Use QDateTimeParser::locale(), not the default QLocale QDateTimeParser::parseSection() used the default locale instead of the one configured. Change-Id: Ie31aa87670cc5ceaf8d937a907807445f44bf7f9 Reviewed-by: Thiago Macieira Reviewed-by: Andreas Buhr Reviewed-by: Andrei Golubev --- src/corelib/time/qdatetimeparser.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/corelib/time/qdatetimeparser.cpp') diff --git a/src/corelib/time/qdatetimeparser.cpp b/src/corelib/time/qdatetimeparser.cpp index eb495318a1..13dd4793bf 100644 --- a/src/corelib/time/qdatetimeparser.cpp +++ b/src/corelib/time/qdatetimeparser.cpp @@ -817,7 +817,7 @@ QDateTimeParser::parseSection(const QDateTime ¤tValue, int sectionIndex, i } const int absMax = absoluteMax(sectionIndex); - QLocale loc; + const QLocale loc = locale(); bool ok = true; int last = -1, used = -1; @@ -825,7 +825,7 @@ QDateTimeParser::parseSection(const QDateTime ¤tValue, int sectionIndex, i QStringView digitsStr = sectionTextRef.left(sectiontextSize); for (int digits = sectiontextSize; digits >= 1; --digits) { digitsStr.truncate(digits); - int tmp = (int)loc.toUInt(digitsStr, &ok); + int tmp = int(loc.toUInt(digitsStr, &ok)); if (ok && sn.type == Hour12Section) { if (tmp > 12) { tmp = -1; -- cgit v1.2.3