diff options
Diffstat (limited to 'src/corelib/tools')
-rw-r--r-- | src/corelib/tools/qbytearraylist.h | 2 | ||||
-rw-r--r-- | src/corelib/tools/qlist.h | 6 | ||||
-rw-r--r-- | src/corelib/tools/qlocale_mac.mm | 14 | ||||
-rw-r--r-- | src/corelib/tools/qsharedpointer.cpp | 27 | ||||
-rw-r--r-- | src/corelib/tools/qsharedpointer.h | 4 | ||||
-rw-r--r-- | src/corelib/tools/qstringlist.h | 2 |
6 files changed, 24 insertions, 31 deletions
diff --git a/src/corelib/tools/qbytearraylist.h b/src/corelib/tools/qbytearraylist.h index d69e8bb54b..1261e1757c 100644 --- a/src/corelib/tools/qbytearraylist.h +++ b/src/corelib/tools/qbytearraylist.h @@ -67,7 +67,7 @@ template <> struct QListSpecialMethods<QByteArray> { #ifndef Q_CLANG_QDOC protected: - ~QListSpecialMethods() {} + ~QListSpecialMethods() = default; #endif public: inline QByteArray join() const diff --git a/src/corelib/tools/qlist.h b/src/corelib/tools/qlist.h index 513d7eafe1..25380d45ec 100644 --- a/src/corelib/tools/qlist.h +++ b/src/corelib/tools/qlist.h @@ -74,7 +74,7 @@ template <typename T> class QSet; template <typename T> struct QListSpecialMethods { protected: - ~QListSpecialMethods() {} + ~QListSpecialMethods() = default; }; template <> struct QListSpecialMethods<QByteArray>; template <> struct QListSpecialMethods<QString>; @@ -247,6 +247,8 @@ public: // can't remove it in Qt 5, since doing so would make the type trivial, // which changes the way it's passed to functions by value. inline iterator(const iterator &o) noexcept : i(o.i){} + inline iterator &operator=(const iterator &o) noexcept + { i = o.i; return *this; } #endif inline T &operator*() const { return i->t(); } inline T *operator->() const { return &i->t(); } @@ -300,6 +302,8 @@ public: // can't remove it in Qt 5, since doing so would make the type trivial, // which changes the way it's passed to functions by value. inline const_iterator(const const_iterator &o) noexcept : i(o.i) {} + inline const_iterator &operator=(const const_iterator &o) noexcept + { i = o.i; return *this; } #endif #ifdef QT_STRICT_ITERATORS inline explicit const_iterator(const iterator &o) noexcept : i(o.i) {} 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 0aedf4c6d6..cb6ba38f29 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> diff --git a/src/corelib/tools/qstringlist.h b/src/corelib/tools/qstringlist.h index cf136a64c6..81748e9a0b 100644 --- a/src/corelib/tools/qstringlist.h +++ b/src/corelib/tools/qstringlist.h @@ -67,7 +67,7 @@ template <> struct QListSpecialMethods<QString> { #ifndef Q_QDOC protected: - ~QListSpecialMethods() {} + ~QListSpecialMethods() = default; #endif public: inline void sort(Qt::CaseSensitivity cs = Qt::CaseSensitive); |