diff options
author | Jarek Kobus <jaroslaw.kobus@qt.io> | 2020-06-29 12:40:43 +0200 |
---|---|---|
committer | Jarek Kobus <jaroslaw.kobus@qt.io> | 2020-06-29 15:37:26 +0200 |
commit | 4ac9e1d7e6a9490c9eb8b3b5d60de441b1708882 (patch) | |
tree | fd71167c749c1e0074844e9fcba27d343454d8dd /tests | |
parent | e778518ee72e743009e6c628bd523e35f8aedac1 (diff) |
Use QList instead of QVector
Task-number: QTBUG-84469
Change-Id: Ide3fa7a558b456354703dd7fd5ee414647e24934
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/webchannel/tst_webchannel.cpp | 6 | ||||
-rw-r--r-- | tests/auto/webchannel/tst_webchannel.h | 9 |
2 files changed, 6 insertions, 9 deletions
diff --git a/tests/auto/webchannel/tst_webchannel.cpp b/tests/auto/webchannel/tst_webchannel.cpp index a1e824b..f5df593 100644 --- a/tests/auto/webchannel/tst_webchannel.cpp +++ b/tests/auto/webchannel/tst_webchannel.cpp @@ -875,8 +875,8 @@ void TestWebChannel::testWrapValues() QCOMPARE(value.toInt(), (int) flags); } { - QVector<int> vec{1, 2, 3}; - QVariant variant = QVariant::fromValue(vec); + QList<int> list { 1, 2, 3 }; + QVariant variant = QVariant::fromValue(list); QJsonValue value = channel.d_func()->publisher->wrapResult(variant, m_dummyTransport); QVERIFY(value.isArray()); QCOMPARE(value.toArray(), QJsonArray({1, 2, 3})); @@ -1090,7 +1090,7 @@ void TestWebChannel::benchPropertyUpdates() QObject parent; const QHash<QString, QObject*> objects = createObjects(&parent); - QVector<BenchObject*> objectList; + QList<BenchObject *> objectList; objectList.reserve(objects.size()); foreach (QObject *obj, objects) { objectList << qobject_cast<BenchObject*>(obj); diff --git a/tests/auto/webchannel/tst_webchannel.h b/tests/auto/webchannel/tst_webchannel.h index eae21f4..c64cd05 100644 --- a/tests/auto/webchannel/tst_webchannel.h +++ b/tests/auto/webchannel/tst_webchannel.h @@ -32,7 +32,7 @@ #include <QObject> #include <QVariant> -#include <QVector> +#include <QList> #include <QJsonValue> #include <QJsonObject> #include <QJsonArray> @@ -68,10 +68,7 @@ public: emit messageReceived(message, this); } - QVector<QJsonObject> messagesSent() const - { - return mMessagesSent; - } + QList<QJsonObject> messagesSent() const { return mMessagesSent; } public slots: void sendMessage(const QJsonObject &message) override @@ -79,7 +76,7 @@ public slots: mMessagesSent.push_back(message); } private: - QVector<QJsonObject> mMessagesSent; + QList<QJsonObject> mMessagesSent; }; class TestObject : public QObject |