qt5base-lts/util
Edward Welbourne 71fa90a37c Enable system locale to skip digit-grouping if configured to do so
On macOS it's possible to configure the system locale to not do digit
grouping (separating "thousands", in most western locales); it then
returns an empty string when asked for the grouping character, which
QLocale's system-configuration then ignored, falling back on using the
base UI locale's grouping separator. This could lead to the same
separator being used for decimal and grouping, which should never
happen, least of all when configured to not group at all.

In order to notice when this happens, query() must take care to return
an empty QString (as a QVariant, which is then non-null) when it *has*
a value for the locale property, and that value is empty, as opposed
to a null QVariant when it doesn't find a configured value. The caller
can then distinguish the two cases.

Furthermore, the group and decimal separators need to be distinct, so
we need to take care to avoid cases where the system overrides one
with what the CLDR has given for the other and doesn't over-ride that
other.

Only presently implemented for macOS and MS-Win, since the (other)
Unix implementation of the system locale returns single QChar values
for the numeric tokens - see QTBUG-69324, QTBUG-81053.

Fixes: QTBUG-80459
Change-Id: Ic3fbb0fb86e974604a60781378b09abc13bab15d
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2020-02-03 15:34:02 +01:00
..
accessibilityinspector Updated license headers 2016-01-21 18:55:18 +00:00
aglfn Updated license headers 2016-01-21 18:55:18 +00:00
corelib/qurl-generateTLDs Compile-fixes in the generator for qurltld_p.h 2019-10-25 11:43:04 +02:00
edid Minor grammar fixup 2018-08-03 18:11:24 +00:00
glgen glgen: Fix compile error 2020-01-31 14:02:53 +01:00
gradientgen Add cmdline feature to qmake 2019-02-18 07:12:14 +00:00
harfbuzz Initial import from the monolithic Qt. 2011-04-27 12:05:43 +02:00
includemocs QtCore: include mocs 2017-05-05 03:03:30 +00:00
integrity Initial import from the monolithic Qt. 2011-04-27 12:05:43 +02:00
lexgen Remove usages of deprecated APIs from QtAlgorithms 2019-06-29 21:58:36 +02:00
locale_database Enable system locale to skip digit-grouping if configured to do so 2020-02-03 15:34:02 +01:00
plugintest Updated license headers 2016-01-21 18:55:18 +00:00
qfloat16-tables Merge remote-tracking branch 'origin/5.13' into 5.14 2019-11-06 11:41:19 +01:00
unicode Correct some references to corelib/tools/ to say corelib/text/ 2019-10-25 11:44:27 +02:00
x86simdgen SIMD: Change the way we declare constants for x86 2018-07-09 00:18:30 +00:00
xkbdatagen Updated license headers 2016-01-21 18:55:18 +00:00