summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/corelib/tools/qlocale.cpp8
-rw-r--r--src/corelib/tools/qlocale.h8
2 files changed, 14 insertions, 2 deletions
diff --git a/src/corelib/tools/qlocale.cpp b/src/corelib/tools/qlocale.cpp
index 1f4d0c88c5..bbba18fa27 100644
--- a/src/corelib/tools/qlocale.cpp
+++ b/src/corelib/tools/qlocale.cpp
@@ -869,6 +869,14 @@ bool QLocale::operator!=(const QLocale &other) const
}
/*!
+ \fn void QLocale::swap(QLocale &other)
+ \since 5.6
+
+ Swaps locale \a other with this locale. This operation is very fast and
+ never fails.
+*/
+
+/*!
\since 5.6
\relates QLocale
diff --git a/src/corelib/tools/qlocale.h b/src/corelib/tools/qlocale.h
index e90354138c..b10dee509f 100644
--- a/src/corelib/tools/qlocale.h
+++ b/src/corelib/tools/qlocale.h
@@ -866,9 +866,13 @@ public:
QLocale(Language language, Country country = AnyCountry);
QLocale(Language language, Script script, Country country);
QLocale(const QLocale &other);
+#ifdef Q_COMPILER_RVALUE_REFS
+ QLocale &operator=(QLocale &&other) Q_DECL_NOTHROW { swap(other); return *this; }
+#endif
+ QLocale &operator=(const QLocale &other);
~QLocale();
- QLocale &operator=(const QLocale &other);
+ void swap(QLocale &other) Q_DECL_NOTHROW { qSwap(d, other.d); }
Language language() const;
Script script() const;
@@ -994,7 +998,7 @@ private:
QSharedDataPointer<QLocalePrivate> d;
};
-Q_DECLARE_TYPEINFO(QLocale, Q_MOVABLE_TYPE);
+Q_DECLARE_SHARED(QLocale)
Q_DECLARE_OPERATORS_FOR_FLAGS(QLocale::NumberOptions)
inline QString QLocale::toString(short i) const