From d5b7b4e41cb9fa6cd14129336ce853a0564a7fea Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Wed, 26 Mar 2014 15:21:38 +0100 Subject: QStringList: add op= overloads for QList QStringList = QList already compiled, but was interpreted as QStringList = QStringList(QList), which involves the QList copy ctor. Adding the overload saves that copy. Cannot use a using declaration here, since the return type is different. Change-Id: I9f4feb2f97480d2d6a3b6fa7c71b5d511b623601 Reviewed-by: Thiago Macieira --- src/corelib/tools/qstringlist.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'src/corelib/tools/qstringlist.cpp') 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 @@ -203,6 +203,27 @@ QT_BEGIN_NAMESPACE \sa operator=() */ +/*! + \fn QStringList &QStringList::operator=(const QList &other) + \since 5.4 + + Copy assignment operator from QList. 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 &&other) + \overload + \since 5.4 + + Move assignment operator from QList. 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) -- cgit v1.2.3