summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/tools')
-rw-r--r--src/corelib/tools/qlocale_mac.mm14
-rw-r--r--src/corelib/tools/qsharedpointer.cpp27
-rw-r--r--src/corelib/tools/qsharedpointer.h4
3 files changed, 17 insertions, 28 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()));
diff --git a/src/corelib/tools/qsharedpointer.cpp b/src/corelib/tools/qsharedpointer.cpp
index 62b76c5bb7..9e9466f6b1 100644
--- a/src/corelib/tools/qsharedpointer.cpp
+++ b/src/corelib/tools/qsharedpointer.cpp
@@ -649,19 +649,7 @@
*/
/*!
- \fn template <class T> QSharedPointer<T> QSharedPointer<T>::create()
- \since 5.1
-
- Creates a QSharedPointer object and allocates a new item of type \tt T. The
- QSharedPointer internals and the object are allocated in one single memory
- allocation, which could help reduce memory fragmentation in a long-running
- application.
-
- This function calls the default constructor for type \tt T.
-*/
-
-/*!
- \fn template <class T> QSharedPointer<T> QSharedPointer<T>::create(...)
+ \fn template <class T> template <typename... Args> QSharedPointer<T> QSharedPointer<T>::create(Args &&... args)
\overload
\since 5.1
@@ -671,18 +659,7 @@
application.
This function will attempt to call a constructor for type \tt T that can
- accept all the arguments passed. Arguments will be perfectly-forwarded.
-
- \note This function is only fully available with a C++11 compiler that
- supports perfect forwarding of an arbitrary number of arguments.
-
- If the compiler does not support the necessary C++11 features,
- then a restricted version is available since Qt 5.4: you may pass
- one (but just one) argument, and it will always be passed by const
- reference.
-
- If you target Qt before version 5.4, you must use the overload
- that calls the default constructor.
+ accept all the arguments passed (\a args). Arguments will be perfectly-forwarded.
*/
/*!
diff --git a/src/corelib/tools/qsharedpointer.h b/src/corelib/tools/qsharedpointer.h
index 98b38b97d3..a2c5f990fc 100644
--- a/src/corelib/tools/qsharedpointer.h
+++ b/src/corelib/tools/qsharedpointer.h
@@ -97,8 +97,8 @@ public:
template <class X> QSharedPointer<X> constCast() const;
template <class X> QSharedPointer<X> objectCast() const;
- static inline QSharedPointer<T> create();
- static inline QSharedPointer<T> create(...);
+ template <typename... Args>
+ static inline QSharedPointer<T> create(Args &&... args);
};
template <class T>