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 /tests/auto/corelib/tools/qstringlist | |
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 'tests/auto/corelib/tools/qstringlist')
-rw-r--r-- | tests/auto/corelib/tools/qstringlist/tst_qstringlist.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/auto/corelib/tools/qstringlist/tst_qstringlist.cpp b/tests/auto/corelib/tools/qstringlist/tst_qstringlist.cpp index 246560e47f..a9ddb6844e 100644 --- a/tests/auto/corelib/tools/qstringlist/tst_qstringlist.cpp +++ b/tests/auto/corelib/tools/qstringlist/tst_qstringlist.cpp @@ -321,8 +321,13 @@ void tst_QStringList::streamingOperator() list << "hei"; list << list << "hopp" << list; + QList<QString> slist = list; + list << slist; + QCOMPARE(list, QStringList() << "hei" << "hei" << "hopp" + << "hei" << "hei" << "hopp" + << "hei" << "hei" << "hopp" << "hei" << "hei" << "hopp"); QStringList list2; |