diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2014-03-26 15:21:38 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-03-31 22:54:14 +0200 |
commit | 47d2d19cf6bceb0421f5dbff3686ec093daeba1c (patch) | |
tree | 340601877aff076769b4e8a32869a89759f89aca /src/corelib/tools/qstringlist.cpp | |
parent | 2a9d3b7a46ce822478d7845f92dc0edc677a2dfb (diff) |
QStringList: add op<< overload for QList<QString>
QStringList << QList<QString> already compiled, but was interpreted as
QStringList << QStringList(QList<QString>), 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: I119cc98e7e2df24549a1abb158543b729edc30ef
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
Diffstat (limited to 'src/corelib/tools/qstringlist.cpp')
-rw-r--r-- | src/corelib/tools/qstringlist.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/corelib/tools/qstringlist.cpp b/src/corelib/tools/qstringlist.cpp index 3f63b3b8e7..a7379b144c 100644 --- a/src/corelib/tools/qstringlist.cpp +++ b/src/corelib/tools/qstringlist.cpp @@ -478,6 +478,16 @@ QString QtPrivate::QStringList_join(const QStringList *that, const QChar *sep, i the latter string list. */ +/*! + \fn QStringList &QStringList::operator<<(const QList<QString> &other) + \since 5.4 + + \overload + + Appends the \a other string list to the string list and returns a reference to + the latter string list. +*/ + #ifndef QT_NO_DATASTREAM /*! \fn QDataStream &operator>>(QDataStream &in, QStringList &list) |