QCollator(SortKey): add member-swap

This is required for a Qt value type these days.

Change-Id: Ibd4e1581a4f4791a410caa10fede92c26b35dd9d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
bb10
Marc Mutz 2013-11-13 11:27:11 +01:00 committed by The Qt Project
parent 4225e71038
commit 2c450d90b6
2 changed files with 13 additions and 1 deletions

View File

@ -117,6 +117,13 @@ QCollator &QCollator::operator=(const QCollator &other)
return *this;
}
/*!
\fn void QCollator::swap(QCollator &other)
Swaps this collator with \a other. This function is very fast and
never fails.
*/
/*!
\internal
*/

View File

@ -61,8 +61,10 @@ public:
QCollatorSortKey &operator=(const QCollatorSortKey &other);
#ifdef Q_COMPILER_RVALUE_REFS
inline QCollatorSortKey &operator=(QCollatorSortKey &&other)
{ qSwap(d, other.d); return *this; }
{ swap(other); return *this; }
#endif
void swap(QCollatorSortKey &other)
{ d.swap(other.d); }
bool operator<(const QCollatorSortKey &key) const;
int compare(const QCollatorSortKey &key) const;
@ -84,6 +86,9 @@ public:
~QCollator();
QCollator &operator=(const QCollator &);
void swap(QCollator &other)
{ qSwap(d, other.d); }
void setLocale(const QLocale &locale);
QLocale locale() const;