diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/corelib/tools/qstringlist.cpp | 21 | ||||
-rw-r--r-- | src/corelib/tools/qstringlist.h | 7 |
2 files changed, 28 insertions, 0 deletions
diff --git a/src/corelib/tools/qstringlist.cpp b/src/corelib/tools/qstringlist.cpp index a9d704ca4c..c735fbcc42 100644 --- a/src/corelib/tools/qstringlist.cpp +++ b/src/corelib/tools/qstringlist.cpp @@ -204,6 +204,27 @@ QT_BEGIN_NAMESPACE */ /*! + \fn QStringList &QStringList::operator=(const QList<QString> &other) + \since 5.4 + + Copy assignment operator from QList<QString>. Assigns the \a other + list of strings to this string list. + + After the operation, \a other and \c *this will be equal. +*/ + +/*! + \fn QStringList &QStringList::operator=(QList<QString> &&other) + \overload + \since 5.4 + + Move assignment operator from QList<QString>. Moves the \a other + list of strings to this string list. + + After the operation, \a other will be empty. +*/ + +/*! \fn void QStringList::sort(Qt::CaseSensitivity cs) Sorts the list of strings in ascending order. diff --git a/src/corelib/tools/qstringlist.h b/src/corelib/tools/qstringlist.h index 1cdafb4ec2..271599b9d7 100644 --- a/src/corelib/tools/qstringlist.h +++ b/src/corelib/tools/qstringlist.h @@ -68,6 +68,13 @@ public: inline QStringList(std::initializer_list<QString> args) : QList<QString>(args) { } #endif + QStringList &operator=(const QList<QString> &other) + { QList<QString>::operator=(other); return *this; } +#ifdef Q_COMPILER_RVALUE_REFS + QStringList &operator=(QList<QString> &&other) + { QList<QString>::operator=(std::move(other)); return *this; } +#endif + inline void sort(Qt::CaseSensitivity cs = Qt::CaseSensitive); inline int removeDuplicates(); |