diff options
author | Liang Qi <liang.qi@qt.io> | 2019-05-03 08:56:55 +0000 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2019-05-03 12:55:47 +0000 |
commit | 76efe79d5cafcda16a986e26f5f6ef973c94b325 (patch) | |
tree | 687ce134a2b8142f1617f664d85e2ea479720174 /src/corelib/tools/qlocale_mac.mm | |
parent | 42d865e08c68146f2565679b3cf75d75bdee9d35 (diff) | |
parent | b5c2535eb0da4ad2b65e79df288a3674f3118717 (diff) |
Merge "Merge remote-tracking branch 'origin/5.12' into 5.13" into refs/staging/5.13
Diffstat (limited to 'src/corelib/tools/qlocale_mac.mm')
-rw-r--r-- | src/corelib/tools/qlocale_mac.mm | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/corelib/tools/qlocale_mac.mm b/src/corelib/tools/qlocale_mac.mm index edbaaf5d18..574cb0714c 100644 --- a/src/corelib/tools/qlocale_mac.mm +++ b/src/corelib/tools/qlocale_mac.mm @@ -332,6 +332,17 @@ static QString macCurrencySymbol(QLocale::CurrencySymbolFormat format) return QString(); } +static QString macZeroDigit() +{ + QCFType<CFLocaleRef> locale = CFLocaleCopyCurrent(); + QCFType<CFNumberFormatterRef> numberFormatter = + CFNumberFormatterCreate(nullptr, locale, kCFNumberFormatterNoStyle); + static const int zeroDigit = 0; + QCFType<CFStringRef> value = CFNumberFormatterCreateStringWithValue(nullptr, numberFormatter, + kCFNumberIntType, &zeroDigit); + return QString::fromCFString(value); +} + #ifndef QT_NO_SYSTEMLOCALE static QString macFormatCurrency(const QSystemLocale::CurrencyToStringArgument &arg) { @@ -437,8 +448,9 @@ QVariant QSystemLocale::query(QueryType type, QVariant in = QVariant()) const case NegativeSign: case PositiveSign: - case ZeroDigit: break; + case ZeroDigit: + return QVariant(macZeroDigit()); case MeasurementSystem: return QVariant(static_cast<int>(macMeasurementSystem())); |