summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qstringlist.h
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2014-03-26 15:21:38 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-03-31 22:54:14 +0200
commit47d2d19cf6bceb0421f5dbff3686ec093daeba1c (patch)
tree340601877aff076769b4e8a32869a89759f89aca /src/corelib/tools/qstringlist.h
parent2a9d3b7a46ce822478d7845f92dc0edc677a2dfb (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.h')
-rw-r--r--src/corelib/tools/qstringlist.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/corelib/tools/qstringlist.h b/src/corelib/tools/qstringlist.h
index 11a4d87890..1cdafb4ec2 100644
--- a/src/corelib/tools/qstringlist.h
+++ b/src/corelib/tools/qstringlist.h
@@ -85,6 +85,8 @@ public:
{ append(str); return *this; }
inline QStringList &operator<<(const QStringList &l)
{ *this += l; return *this; }
+ inline QStringList &operator<<(const QList<QString> &l)
+ { *this += l; return *this; }
#ifndef QT_NO_REGEXP
inline QStringList filter(const QRegExp &rx) const;