summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qlocale_mac.mm
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2019-05-03 08:56:55 +0000
committerThe Qt Project <gerrit-noreply@qt-project.org>2019-05-03 12:55:47 +0000
commit76efe79d5cafcda16a986e26f5f6ef973c94b325 (patch)
tree687ce134a2b8142f1617f664d85e2ea479720174 /src/corelib/tools/qlocale_mac.mm
parent42d865e08c68146f2565679b3cf75d75bdee9d35 (diff)
parentb5c2535eb0da4ad2b65e79df288a3674f3118717 (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.mm14
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()));