diff options
author | Jarek Kobus <jaroslaw.kobus@qt.io> | 2020-07-08 14:17:04 +0200 |
---|---|---|
committer | Jarek Kobus <jaroslaw.kobus@qt.io> | 2020-07-09 12:22:15 +0200 |
commit | 93bd28e6d4ac8fdb6b07b30684e6b17ee515e44e (patch) | |
tree | 47c1299f1f7341e55c3c21d82425804aef2ac976 | |
parent | 1f7408d26d0274c9cbbfb2394778c721888af291 (diff) |
Use QList instead of QVector in tests
Fix some const correctness.
Use list-initialization.
Task-number: QTBUG-84469
Change-Id: I48e643bd20e21bee031555af598ad95d9873de12
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
86 files changed, 709 insertions, 832 deletions
diff --git a/tests/auto/animation/additiveclipblend/tst_additiveclipblend.cpp b/tests/auto/animation/additiveclipblend/tst_additiveclipblend.cpp index 8e8ce43db..bd39ec04a 100644 --- a/tests/auto/animation/additiveclipblend/tst_additiveclipblend.cpp +++ b/tests/auto/animation/additiveclipblend/tst_additiveclipblend.cpp @@ -49,14 +49,14 @@ public: , m_duration(duration) {} - inline QVector<Qt3DCore::QNodeId> allDependencyIds() const override + inline QList<Qt3DCore::QNodeId> allDependencyIds() const override { return currentDependencyIds(); } - QVector<Qt3DCore::QNodeId> currentDependencyIds() const final + QList<Qt3DCore::QNodeId> currentDependencyIds() const final { - return QVector<Qt3DCore::QNodeId>(); + return {}; } using ClipBlendNode::setClipResults; @@ -64,7 +64,7 @@ public: double duration() const final { return m_duration; } protected: - ClipResults doBlend(const QVector<ClipResults> &) const final { return ClipResults(); } + ClipResults doBlend(const QList<ClipResults> &) const final { return ClipResults(); } private: double m_duration; @@ -217,7 +217,7 @@ private Q_SLOTS: // WHEN addBlend.setBaseClipId(baseClipId); addBlend.setAdditiveClipId(additiveClipId); - QVector<Qt3DCore::QNodeId> actualIds = addBlend.currentDependencyIds(); + QList<Qt3DCore::QNodeId> actualIds = addBlend.currentDependencyIds(); // THEN QCOMPARE(actualIds.size(), 2); diff --git a/tests/auto/animation/animationutils/tst_animationutils.cpp b/tests/auto/animation/animationutils/tst_animationutils.cpp index 689a9ac02..9fe5493aa 100644 --- a/tests/auto/animation/animationutils/tst_animationutils.cpp +++ b/tests/auto/animation/animationutils/tst_animationutils.cpp @@ -89,7 +89,7 @@ public: QList<Qt3DCore::QNodeId> currentDependencyIds() const final { - return QList<Qt3DCore::QNodeId> { m_value1Id, m_value2Id }; + return { m_value1Id, m_value2Id }; } using ClipBlendNode::setClipResults; diff --git a/tests/auto/animation/bezierevaluator/tst_bezierevaluator.cpp b/tests/auto/animation/bezierevaluator/tst_bezierevaluator.cpp index 27daaea48..aa3679aef 100644 --- a/tests/auto/animation/bezierevaluator/tst_bezierevaluator.cpp +++ b/tests/auto/animation/bezierevaluator/tst_bezierevaluator.cpp @@ -38,6 +38,23 @@ Q_DECLARE_METATYPE(Qt3DAnimation::Animation::Keyframe) using namespace Qt3DAnimation; using namespace Qt3DAnimation::Animation; +static const QList<float> globalTimes = { 0.0f, 1.00375f, 2.48f, + 4.37625f, 6.64f, 9.21875f, + 12.06f, 15.11125f, 18.32f, + 21.63375f, 25.0f, 28.36625f, + 31.68f, 34.88875f, 37.94f, + 40.78125f, 43.36f, 45.62375f, + 47.52f, 48.99625f, 50.0f }; + +static const QList<float> globalValues = { 0.0f, 0.03625f, 0.14f, + 0.30375f, 0.52f, 0.78125f, + 1.08f, 1.40875f, 1.76f, + 2.12625f, 2.5f, 2.87375f, + 3.24f, 3.59125f, 3.92f, + 4.21875f, 4.48f, 4.69625f, + 4.86f, 4.96375f, 5.0f }; + + class tst_BezierEvaluator : public QObject { Q_OBJECT @@ -55,14 +72,14 @@ private Q_SLOTS: QTest::addColumn<float>("c"); QTest::addColumn<float>("d"); QTest::addColumn<int>("rootCount"); - QTest::addColumn<QVector<float>>("roots"); + QTest::addColumn<QList<float>>("roots"); float a = 1.0f; float b = 0.0f; float c = 0.0f; float d = 0.0f; int rootCount = 1; - QVector<float> roots = { 0.0f }; + QList<float> roots = { 0.0f }; QTest::newRow("a=1, b=0, c=0, d=0") << a << b << c << d << rootCount << roots; roots.clear(); @@ -209,7 +226,7 @@ private Q_SLOTS: QFETCH(float, c); QFETCH(float, d); QFETCH(int, rootCount); - QFETCH(QVector<float>, roots); + QFETCH(QList<float>, roots); float coeffs[4]; coeffs[0] = d; @@ -231,8 +248,8 @@ private Q_SLOTS: QTest::addColumn<Keyframe>("kf0"); QTest::addColumn<float>("t1"); QTest::addColumn<Keyframe>("kf1"); - QTest::addColumn<QVector<float>>("times"); - QTest::addColumn<QVector<float>>("bezierParamters"); + QTest::addColumn<QList<float>>("times"); + QTest::addColumn<QList<float>>("bezierParamters"); { float t0 = 0.0f; @@ -240,37 +257,15 @@ private Q_SLOTS: float t1 = 50.0f; Keyframe kf1{5.0f, {45.0f, 5.0f}, {55.0f, 5.0f}, QKeyFrame::BezierInterpolation}; const int count = 21; - QVector<float> times = (QVector<float>() - << 0.0f - << 1.00375f - << 2.48f - << 4.37625f - << 6.64f - << 9.21875f - << 12.06f - << 15.11125f - << 18.32f - << 21.63375f - << 25.0f - << 28.36625f - << 31.68f - << 34.88875f - << 37.94f - << 40.78125f - << 43.36f - << 45.62375f - << 47.52f - << 48.99625f - << 50.0f); - - QVector<float> bezierParameters; + + QList<float> bezierParameters; float deltaU = 1.0f / float(count - 1); for (int i = 0; i < count; ++i) bezierParameters.push_back(float(i) * deltaU); QTest::newRow("t=0 to t=50, default easing") << t0 << kf0 << t1 << kf1 - << times << bezierParameters; + << globalTimes << bezierParameters; } { // This test creates a case where the coefficients for finding @@ -282,8 +277,8 @@ private Q_SLOTS: Keyframe kf0{150.0f, {0.0f, 0.0f}, {5.80961999f, 150.0f}, QKeyFrame::BezierInterpolation}; float t1 = 10.0f; Keyframe kf1{-150.0f, {7.904809959f, 150.0f}, {0.f, 0.f}, QKeyFrame::BezierInterpolation}; - QVector<float> times = {10.f}; - QVector<float> results = {1.0f}; + QList<float> times = { 10.f }; + QList<float> results = { 1.0f }; QTest::newRow("t=0 to t=10, regression") << t0 << kf0 << t1 << kf1 << times << results; @@ -297,8 +292,8 @@ private Q_SLOTS: QFETCH(Keyframe, kf0); QFETCH(float, t1); QFETCH(Keyframe, kf1); - QFETCH(QVector<float>, times); - QFETCH(QVector<float>, bezierParamters); + QFETCH(QList<float>, times); + QFETCH(QList<float>, bezierParamters); // WHEN BezierEvaluator bezier(t0, kf0, t1, kf1); @@ -317,62 +312,17 @@ private Q_SLOTS: QTest::addColumn<Keyframe>("kf0"); QTest::addColumn<float>("t1"); QTest::addColumn<Keyframe>("kf1"); - QTest::addColumn<QVector<float>>("times"); - QTest::addColumn<QVector<float>>("values"); + QTest::addColumn<QList<float>>("times"); + QTest::addColumn<QList<float>>("values"); float t0 = 0.0f; Keyframe kf0{0.0f, {-5.0f, 0.0f}, {5.0f, 0.0f}, QKeyFrame::BezierInterpolation}; float t1 = 50.0f; Keyframe kf1{5.0f, {45.0f, 5.0f}, {55.0f, 5.0f}, QKeyFrame::BezierInterpolation}; - QVector<float> times = (QVector<float>() - << 0.0f - << 1.00375f - << 2.48f - << 4.37625f - << 6.64f - << 9.21875f - << 12.06f - << 15.11125f - << 18.32f - << 21.63375f - << 25.0f - << 28.36625f - << 31.68f - << 34.88875f - << 37.94f - << 40.78125f - << 43.36f - << 45.62375f - << 47.52f - << 48.99625f - << 50.0f); - - QVector<float> values = (QVector<float>() - << 0.0f - << 0.03625f - << 0.14f - << 0.30375f - << 0.52f - << 0.78125f - << 1.08f - << 1.40875f - << 1.76f - << 2.12625f - << 2.5f - << 2.87375f - << 3.24f - << 3.59125f - << 3.92f - << 4.21875f - << 4.48f - << 4.69625f - << 4.86f - << 4.96375f - << 5.0f); QTest::newRow("t=0, value=0 to t=50, value=5, default easing") << t0 << kf0 << t1 << kf1 - << times << values; + << globalTimes << globalValues; } void checkValueForTime() @@ -382,8 +332,8 @@ private Q_SLOTS: QFETCH(Keyframe, kf0); QFETCH(float, t1); QFETCH(Keyframe, kf1); - QFETCH(QVector<float>, times); - QFETCH(QVector<float>, values); + QFETCH(QList<float>, times); + QFETCH(QList<float>, values); // WHEN BezierEvaluator bezier(t0, kf0, t1, kf1); diff --git a/tests/auto/animation/channelmapper/tst_channelmapper.cpp b/tests/auto/animation/channelmapper/tst_channelmapper.cpp index 8b75b0a52..214a41d0f 100644 --- a/tests/auto/animation/channelmapper/tst_channelmapper.cpp +++ b/tests/auto/animation/channelmapper/tst_channelmapper.cpp @@ -80,7 +80,7 @@ private Q_SLOTS: // THEN QVERIFY(backendMapper.peerId().isNull()); QCOMPARE(backendMapper.isEnabled(), false); - QCOMPARE(backendMapper.mappingIds(), QVector<Qt3DCore::QNodeId>()); + QCOMPARE(backendMapper.mappingIds(), QList<Qt3DCore::QNodeId>()); // GIVEN Qt3DAnimation::QChannelMapper mapper; @@ -92,7 +92,7 @@ private Q_SLOTS: // THEN QCOMPARE(backendMapper.isEnabled(), false); - QCOMPARE(backendMapper.mappingIds(), QVector<Qt3DCore::QNodeId>()); + QCOMPARE(backendMapper.mappingIds(), QList<Qt3DCore::QNodeId>()); } void checkPropertyChanges() diff --git a/tests/auto/animation/clipblendnode/tst_clipblendnode.cpp b/tests/auto/animation/clipblendnode/tst_clipblendnode.cpp index 62d57206d..9a2d9765b 100644 --- a/tests/auto/animation/clipblendnode/tst_clipblendnode.cpp +++ b/tests/auto/animation/clipblendnode/tst_clipblendnode.cpp @@ -50,14 +50,14 @@ public: , m_clipResults(clipResults) {} - inline QVector<Qt3DCore::QNodeId> allDependencyIds() const override + inline QList<Qt3DCore::QNodeId> allDependencyIds() const override { return currentDependencyIds(); } - QVector<Qt3DCore::QNodeId> currentDependencyIds() const final + QList<Qt3DCore::QNodeId> currentDependencyIds() const final { - return QVector<Qt3DCore::QNodeId>(); + return {}; } using ClipBlendNode::setClipResults; @@ -65,7 +65,7 @@ public: double duration() const final { return 0.0f; } protected: - ClipResults doBlend(const QVector<ClipResults> &) const final + ClipResults doBlend(const QList<ClipResults> &) const final { return m_clipResults; } @@ -157,15 +157,15 @@ private Q_SLOTS: void checkClipResults_data() { QTest::addColumn<TestClipBlendNode *>("blendNode"); - QTest::addColumn<QVector<int>>("indexes"); - QTest::addColumn<QVector<Qt3DCore::QNodeId>>("animatorIds"); - QTest::addColumn<QVector<ClipResults>>("expectedClipResults"); + QTest::addColumn<QList<int>>("indexes"); + QTest::addColumn<QList<Qt3DCore::QNodeId>>("animatorIds"); + QTest::addColumn<QList<ClipResults>>("expectedClipResults"); // Single entry { auto blendNode = new TestClipBlendNode; - QVector<Qt3DCore::QNodeId> animatorIds; - QVector<ClipResults> expectedClipResults; + QList<Qt3DCore::QNodeId> animatorIds; + QList<ClipResults> expectedClipResults; const auto animatorId = Qt3DCore::QNodeId::createId(); animatorIds.push_back(animatorId); @@ -177,7 +177,7 @@ private Q_SLOTS: // Set data and indexes blendNode->setClipResults(animatorId, clipResults); - QVector<int> indexes = QVector<int>() << 0; + const QList<int> indexes = { 0 }; QTest::newRow("single entry") << blendNode << indexes << animatorIds << expectedClipResults; @@ -186,8 +186,8 @@ private Q_SLOTS: // No data { auto blendNode = new TestClipBlendNode; - QVector<Qt3DCore::QNodeId> animatorIds; - QVector<ClipResults> expectedClipResults; + QList<Qt3DCore::QNodeId> animatorIds; + QList<ClipResults> expectedClipResults; auto animatorId = Qt3DCore::QNodeId::createId(); animatorIds.push_back(animatorId); @@ -196,7 +196,7 @@ private Q_SLOTS: expectedClipResults.push_back(clipResults); // Don't set any data - QVector<int> indexes = QVector<int>() << 0; + const QList<int> indexes = { 0 }; QTest::newRow("no entries") << blendNode << indexes << animatorIds << expectedClipResults; @@ -205,8 +205,8 @@ private Q_SLOTS: // Multiple entries, ordered { auto blendNode = new TestClipBlendNode; - QVector<Qt3DCore::QNodeId> animatorIds; - QVector<ClipResults> expectedClipResults; + QList<Qt3DCore::QNodeId> animatorIds; + QList<ClipResults> expectedClipResults; const int animatorCount = 10; for (int j = 0; j < animatorCount; ++j) { @@ -221,7 +221,7 @@ private Q_SLOTS: blendNode->setClipResults(animatorId, clipResults); } - QVector<int> indexes(animatorCount); + QList<int> indexes(animatorCount); std::iota(indexes.begin(), indexes.end(), 0); QTest::newRow("multiple entries, ordered") @@ -231,8 +231,8 @@ private Q_SLOTS: // Multiple entries, unordered { auto blendNode = new TestClipBlendNode; - QVector<Qt3DCore::QNodeId> animatorIds; - QVector<ClipResults> expectedClipResults; + QList<Qt3DCore::QNodeId> animatorIds; + QList<ClipResults> expectedClipResults; const int animatorCount = 10; for (int j = 0; j < animatorCount; ++j) { @@ -248,7 +248,7 @@ private Q_SLOTS: } // Shuffle the animatorIds to randomise the lookups - QVector<int> indexes(animatorCount); + QList<int> indexes(animatorCount); std::iota(indexes.begin(), indexes.end(), 0); std::random_device rd; std::mt19937 generator(rd()); @@ -263,9 +263,9 @@ private Q_SLOTS: { // GIVEN QFETCH(TestClipBlendNode *, blendNode); - QFETCH(QVector<int>, indexes); - QFETCH(QVector<Qt3DCore::QNodeId>, animatorIds); - QFETCH(QVector<ClipResults>, expectedClipResults); + QFETCH(QList<int>, indexes); + QFETCH(QList<Qt3DCore::QNodeId>, animatorIds); + QFETCH(QList<ClipResults>, expectedClipResults); for (int i = 0; i < indexes.size(); ++i) { // WHEN diff --git a/tests/auto/animation/clipblendnodemanager/tst_clipblendnodemanager.cpp b/tests/auto/animation/clipblendnodemanager/tst_clipblendnodemanager.cpp index 489a2f019..c17bba659 100644 --- a/tests/auto/animation/clipblendnodemanager/tst_clipblendnodemanager.cpp +++ b/tests/auto/animation/clipblendnodemanager/tst_clipblendnodemanager.cpp @@ -49,20 +49,20 @@ public: deadCount += 1; } - inline QVector<Qt3DCore::QNodeId> allDependencyIds() const override + inline QList<Qt3DCore::QNodeId> allDependencyIds() const override { return currentDependencyIds(); } - QVector<Qt3DCore::QNodeId> currentDependencyIds() const final + QList<Qt3DCore::QNodeId> currentDependencyIds() const final { - return QVector<Qt3DCore::QNodeId>(); + return {}; } double duration() const final { return 0.0f; } protected: - Qt3DAnimation::Animation::ClipResults doBlend(const QVector<Qt3DAnimation::Animation::ClipResults> &) const final + Qt3DAnimation::Animation::ClipResults doBlend(const QList<Qt3DAnimation::Animation::ClipResults> &) const final { return Qt3DAnimation::Animation::ClipResults(); } diff --git a/tests/auto/animation/clipblendvalue/tst_clipblendvalue.cpp b/tests/auto/animation/clipblendvalue/tst_clipblendvalue.cpp index 75d1ab57f..fce78a0e0 100644 --- a/tests/auto/animation/clipblendvalue/tst_clipblendvalue.cpp +++ b/tests/auto/animation/clipblendvalue/tst_clipblendvalue.cpp @@ -40,7 +40,7 @@ using namespace Qt3DAnimation::Animation; Q_DECLARE_METATYPE(ClipBlendValue *) -Q_DECLARE_METATYPE(QVector<ClipFormat>) +Q_DECLARE_METATYPE(QList<ClipFormat>) class tst_ClipBlendValue : public Qt3DCore::QBackendNodeTester { @@ -132,7 +132,7 @@ private Q_SLOTS: // WHEN clipNode.setClipId(clipId); - QVector<Qt3DCore::QNodeId> actualIds = clipNode.currentDependencyIds(); + QList<Qt3DCore::QNodeId> actualIds = clipNode.currentDependencyIds(); // THEN QCOMPARE(actualIds.size(), 0); @@ -167,15 +167,15 @@ private Q_SLOTS: void checkFormatIndices_data() { QTest::addColumn<ClipBlendValue *>("blendNode"); - QTest::addColumn<QVector<int>>("indexes"); - QTest::addColumn<QVector<Qt3DCore::QNodeId>>("animatorIds"); - QTest::addColumn<QVector<ClipFormat>>("expectedClipFormat"); + QTest::addColumn<QList<int>>("indexes"); + QTest::addColumn<QList<Qt3DCore::QNodeId>>("animatorIds"); + QTest::addColumn<QList<ClipFormat>>("expectedClipFormat"); // Single entry { auto blendNode = new ClipBlendValue; - QVector<Qt3DCore::QNodeId> animatorIds; - QVector<ClipFormat> expectedClipFormat; + QList<Qt3DCore::QNodeId> animatorIds; + QList<ClipFormat> expectedClipFormat; const auto animatorId = Qt3DCore::QNodeId::createId(); animatorIds.push_back(animatorId); @@ -186,7 +186,7 @@ private Q_SLOTS: // Set data and indexes blendNode->setClipFormat(animatorId, clipFormat); - QVector<int> indexes = QVector<int>() << 0; + QList<int> indexes = { 0 }; QTest::newRow("single entry") << blendNode << indexes << animatorIds << expectedClipFormat; @@ -195,8 +195,8 @@ private Q_SLOTS: // Multiple entries, ordered { auto blendNode = new ClipBlendValue; - QVector<Qt3DCore::QNodeId> animatorIds; - QVector<ClipFormat> expectedClipFormat; + QList<Qt3DCore::QNodeId> animatorIds; + QList<ClipFormat> expectedClipFormat; const int animatorCount = 10; for (int j = 0; j < animatorCount; ++j) { @@ -211,7 +211,7 @@ private Q_SLOTS: blendNode->setClipFormat(animatorId, clipFormat); } - QVector<int> indexes(animatorCount); + QList<int> indexes(animatorCount); std::iota(indexes.begin(), indexes.end(), 0); QTest::newRow("multiple entries, ordered") @@ -221,8 +221,8 @@ private Q_SLOTS: // Multiple entries, unordered { auto blendNode = new ClipBlendValue; - QVector<Qt3DCore::QNodeId> animatorIds; - QVector<ClipFormat> expectedClipFormat; + QList<Qt3DCore::QNodeId> animatorIds; + QList<ClipFormat> expectedClipFormat; const int animatorCount = 10; for (int j = 0; j < animatorCount; ++j) { @@ -238,7 +238,7 @@ private Q_SLOTS: } // Shuffle the animatorIds to randomise the lookups - QVector<int> indexes(animatorCount); + QList<int> indexes(animatorCount); std::iota(indexes.begin(), indexes.end(), 0); std::random_device rd; std::mt19937 generator(rd()); @@ -253,9 +253,9 @@ private Q_SLOTS: { // GIVEN QFETCH(ClipBlendValue *, blendNode); - QFETCH(QVector<int>, indexes); - QFETCH(QVector<Qt3DCore::QNodeId>, animatorIds); - QFETCH(QVector<ClipFormat>, expectedClipFormat); + QFETCH(QList<int>, indexes); + QFETCH(QList<Qt3DCore::QNodeId>, animatorIds); + QFETCH(QList<ClipFormat>, expectedClipFormat); for (int i = 0; i < indexes.size(); ++i) { // WHEN diff --git a/tests/auto/animation/findrunningclipanimatorsjob/tst_findrunningclipanimatorsjob.cpp b/tests/auto/animation/findrunningclipanimatorsjob/tst_findrunningclipanimatorsjob.cpp index bfcaae776..b3d6744f2 100644 --- a/tests/auto/animation/findrunningclipanimatorsjob/tst_findrunningclipanimatorsjob.cpp +++ b/tests/auto/animation/findrunningclipanimatorsjob/tst_findrunningclipanimatorsjob.cpp @@ -46,9 +46,9 @@ using namespace Qt3DAnimation::Animation; Q_DECLARE_METATYPE(Qt3DAnimation::Animation::Handler*) -Q_DECLARE_METATYPE(QVector<Qt3DAnimation::Animation::HClipAnimator>) +Q_DECLARE_METATYPE(QList<Qt3DAnimation::Animation::HClipAnimator>) -typedef QHash<ClipAnimator*, QVector<Qt3DAnimation::Animation::MappingData>> MappingDataResults; +using MappingDataResults = QHash<ClipAnimator *, QList<Qt3DAnimation::Animation::MappingData>>; Q_DECLARE_METATYPE(MappingDataResults) class tst_FindRunningClipAnimatorsJob: public Qt3DCore::QBackendNodeTester @@ -76,7 +76,7 @@ public: } ChannelMapper *createChannelMapper(Handler *handler, - const QVector<Qt3DCore::QNodeId> &mappingIds) + const QList<Qt3DCore::QNodeId> &mappingIds) { auto channelMapperId = Qt3DCore::QNodeId::createId(); ChannelMapper *channelMapper = handler->channelMapperManager()->getOrCreateResource(channelMapperId); @@ -116,7 +116,7 @@ private Q_SLOTS: void checkJob_data() { QTest::addColumn<Handler *>("handler"); - QTest::addColumn<QVector<HClipAnimator>>("dirtyClipAnimators"); + QTest::addColumn<QList<HClipAnimator>>("dirtyClipAnimators"); QTest::addColumn<MappingDataResults>("expectedResults"); @@ -124,7 +124,6 @@ private Q_SLOTS: Handler *handler; AnimationClip *clip; ClipAnimator *animator; - QVector<HClipAnimator> dirtyClipAnimators; ChannelMapper *channelMapper; MappingDataResults expectedResults; handler = new Handler(); @@ -134,8 +133,8 @@ private Q_SLOTS: const int loops = 1; animator = createClipAnimator(handler, globalStartTimeNS, loops); animator->setClipId(clip->peerId()); - dirtyClipAnimators = (QVector<HClipAnimator>() - << handler->clipAnimatorManager()->getOrAcquireHandle(animator->peerId())); + const QList<HClipAnimator> dirtyClipAnimators + = { handler->clipAnimatorManager()->getOrAcquireHandle(animator->peerId()) }; auto channelMapping = createChannelMapping(handler, QLatin1String("Location"), @@ -143,10 +142,7 @@ private Q_SLOTS: "translation", static_cast<int>(QVariant::Vector3D), 3); - QVector<ChannelMapping *> channelMappings; - channelMappings.push_back(channelMapping); - - channelMapper = createChannelMapper(handler, QVector<Qt3DCore::QNodeId>() << channelMapping->peerId()); + channelMapper = createChannelMapper(handler, QList<Qt3DCore::QNodeId> { channelMapping->peerId() }); animator->setMapperId(channelMapper->peerId()); animator->setRunning(true); // Has to be marked as running for the job to process it animator->setEnabled(true); // Has to be marked as enabled for the job to process it @@ -157,7 +153,7 @@ private Q_SLOTS: expectedMapping.propertyName = channelMapping->propertyName(); expectedMapping.type = channelMapping->type(); expectedMapping.channelIndices = locationIndices; - expectedResults.insert(animator, QVector<MappingData>() << expectedMapping); + expectedResults.insert(animator, QList<MappingData> { expectedMapping }); QTest::newRow("single mapping") << handler @@ -169,7 +165,6 @@ private Q_SLOTS: Handler *handler; AnimationClip *clip; ClipAnimator *animator; - QVector<HClipAnimator> dirtyClipAnimators; ChannelMapper *channelMapper; MappingDataResults expectedResults; handler = new Handler(); @@ -179,8 +174,8 @@ private Q_SLOTS: const int loops = 1; animator = createClipAnimator(handler, globalStartTimeNS, loops); animator->setClipId(clip->peerId()); - dirtyClipAnimators = (QVector<HClipAnimator>() - << handler->clipAnimatorManager()->getOrAcquireHandle(animator->peerId())); + const QList<HClipAnimator> dirtyClipAnimators + = { handler->clipAnimatorManager()->getOrAcquireHandle(animator->peerId()) }; auto channelMapping = createChannelMapping(handler, QLatin1String("Location"), @@ -188,10 +183,7 @@ private Q_SLOTS: "translation", static_cast<int>(QVariant::Vector3D), 3); - QVector<ChannelMapping *> channelMappings; - channelMappings.push_back(channelMapping); - - channelMapper = createChannelMapper(handler, QVector<Qt3DCore::QNodeId>() << channelMapping->peerId()); + channelMapper = createChannelMapper(handler, QList<Qt3DCore::QNodeId> { channelMapping->peerId() }); animator->setMapperId(channelMapper->peerId()); animator->setRunning(true); // Has to be marked as running for the job to process it animator->setEnabled(false); // Has to be marked as enabled for the job to process it @@ -207,7 +199,7 @@ private Q_SLOTS: { // GIVEN QFETCH(Handler *, handler); - QFETCH(QVector<HClipAnimator>, dirtyClipAnimators); + QFETCH(QList<HClipAnimator>, dirtyClipAnimators); QFETCH(MappingDataResults, expectedResults); FindRunningClipAnimatorsJob job; @@ -219,8 +211,8 @@ private Q_SLOTS: // THEN - check the resulting MappingData on the animator matches the expected results for (const auto &dirtyClipAnimator : dirtyClipAnimators) { const auto animator = handler->clipAnimatorManager()->data(dirtyClipAnimator); - const QVector<MappingData> actualMappingData = animator->mappingData(); - const QVector<MappingData> expectedMappingData = expectedResults[animator]; + const QList<MappingData> actualMappingData = animator->mappingData(); + const QList<MappingData> expectedMappingData = expectedResults[animator]; QCOMPARE(expectedMappingData.size(), actualMappingData.size()); for (int i = 0; i < actualMappingData.size(); ++i) { diff --git a/tests/auto/animation/functionrangefinder/tst_functionrangefinder.cpp b/tests/auto/animation/functionrangefinder/tst_functionrangefinder.cpp index 3786bd58f..62d519b20 100644 --- a/tests/auto/animation/functionrangefinder/tst_functionrangefinder.cpp +++ b/tests/auto/animation/functionrangefinder/tst_functionrangefinder.cpp @@ -39,7 +39,7 @@ private Q_SLOTS: void checkDefaultConstruction() { // GIVEN - QVector<float> data; + QList<float> data; // WHEN FunctionRangeFinder finder(data); @@ -52,11 +52,11 @@ private Q_SLOTS: void checkConstructionWithData_data() { - QTest::addColumn<QVector<float>>("x"); + QTest::addColumn<QList<float>>("x"); QTest::addColumn<int>("correlationThreshold"); QTest::addColumn<bool>("ascending"); - QVector<float> data = { 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f }; + QList<float> data = { 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f }; int correlationThreshold = 1; bool ascending = true; QTest::newRow("10 entries, ascending") << data << correlationThreshold << ascending; @@ -82,7 +82,7 @@ private Q_SLOTS: void checkConstructionWithData() { // GIVEN - QFETCH(QVector<float>, x); + QFETCH(QList<float>, x); QFETCH(int, correlationThreshold); QFETCH(bool, ascending); @@ -97,13 +97,13 @@ private Q_SLOTS: void checkFindLowerBound_data() { - QTest::addColumn<QVector<float>>("x"); - QTest::addColumn<QVector<float>>("needles"); - QTest::addColumn<QVector<int>>("lowerBounds"); + QTest::addColumn<QList<float>>("x"); + QTest::addColumn<QList<float>>("needles"); + QTest::addColumn<QList<int>>("lowerBounds"); - QVector<float> data = { 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f }; - QVector<float> needles = { 2.5f }; - QVector<int> lowerBounds = { 1 }; + QList<float> data = { 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f }; + QList<float> needles = { 2.5f }; + QList<int> lowerBounds = { 1 }; QTest::newRow("10 entries, ascending") << data << needles << lowerBounds; data.clear(); needles.clear(); @@ -153,9 +153,9 @@ private Q_SLOTS: void checkFindLowerBound() { // GIVEN - QFETCH(QVector<float>, x); - QFETCH(QVector<float>, needles); - QFETCH(QVector<int>, lowerBounds); + QFETCH(QList<float>, x); + QFETCH(QList<float>, needles); + QFETCH(QList<int>, lowerBounds); FunctionRangeFinder finder(x); for (int i = 0; i < needles.size(); ++i) { diff --git a/tests/auto/animation/lerpclipblend/tst_lerpclipblend.cpp b/tests/auto/animation/lerpclipblend/tst_lerpclipblend.cpp index 29c982253..d7c889363 100644 --- a/tests/auto/animation/lerpclipblend/tst_lerpclipblend.cpp +++ b/tests/auto/animation/lerpclipblend/tst_lerpclipblend.cpp @@ -49,14 +49,14 @@ public: , m_duration(duration) {} - inline QVector<Qt3DCore::QNodeId> allDependencyIds() const override + inline QList<Qt3DCore::QNodeId> allDependencyIds() const override { return currentDependencyIds(); } - QVector<Qt3DCore::QNodeId> currentDependencyIds() const final + QList<Qt3DCore::QNodeId> currentDependencyIds() const final { - return QVector<Qt3DCore::QNodeId>(); + return {}; } using ClipBlendNode::setClipResults; @@ -64,7 +64,7 @@ public: double duration() const final { return m_duration; } protected: - ClipResults doBlend(const QVector<ClipResults> &) const final { return ClipResults(); } + ClipResults doBlend(const QList<ClipResults> &) const final { return ClipResults(); } private: double m_duration; @@ -192,7 +192,7 @@ private Q_SLOTS: // WHEN lerpBlend.setStartClipId(startClipId); lerpBlend.setEndClipId(endClipId); - QVector<Qt3DCore::QNodeId> actualIds = lerpBlend.currentDependencyIds(); + QList<Qt3DCore::QNodeId> actualIds = lerpBlend.currentDependencyIds(); // THEN QCOMPARE(actualIds.size(), 2); diff --git a/tests/auto/animation/qanimationcontroller/tst_qanimationcontroller.cpp b/tests/auto/animation/qanimationcontroller/tst_qanimationcontroller.cpp index 4774dc8ba..4149ec116 100644 --- a/tests/auto/animation/qanimationcontroller/tst_qanimationcontroller.cpp +++ b/tests/auto/animation/qanimationcontroller/tst_qanimationcontroller.cpp @@ -199,7 +199,7 @@ private Q_SLOTS: animationController.setEntity(entity.data()); // THEN - QVector<Qt3DAnimation::QAnimationGroup *> list = animationController.animationGroupList(); + const QList<Qt3DAnimation::QAnimationGroup *> list = animationController.animationGroupList(); QCOMPARE(list.size(), 2); QCOMPARE(list.at(0)->name(), animName1); @@ -233,7 +233,7 @@ private Q_SLOTS: animationController.setEntity(entity.data()); // THEN - QVector<Qt3DAnimation::QAnimationGroup *> list = animationController.animationGroupList(); + const QList<Qt3DAnimation::QAnimationGroup *> list = animationController.animationGroupList(); QCOMPARE(list.size(), 2); QCOMPARE(list.at(0)->name(), animName1); @@ -251,7 +251,7 @@ private Q_SLOTS: animationController.setEntity(entity.data()); // THEN - QVector<Qt3DAnimation::QAnimationGroup *> list = animationController.animationGroupList(); + const QList<Qt3DAnimation::QAnimationGroup *> list = animationController.animationGroupList(); QCOMPARE(list.size(), 1); QCOMPARE(list.at(0)->name(), animName1); diff --git a/tests/auto/animation/qchannelmapping/tst_qchannelmapping.cpp b/tests/auto/animation/qchannelmapping/tst_qchannelmapping.cpp index 1b7d2123c..10283d0d6 100644 --- a/tests/auto/animation/qchannelmapping/tst_qchannelmapping.cpp +++ b/tests/auto/animation/qchannelmapping/tst_qchannelmapping.cpp @@ -48,7 +48,7 @@ class tst_QTargetEntity : public Qt3DCore::QEntity Q_PROPERTY(QVector4D vec4Property MEMBER m_vec4Property NOTIFY vec4PropertyChanged) Q_PROPERTY(QQuaternion quaternionProperty MEMBER m_quaternionProperty NOTIFY quaternionPropertyChanged) Q_PROPERTY(QVariantList listProperty MEMBER m_listProperty NOTIFY listPropertyChanged) - Q_PROPERTY(QVector<float> vecProperty MEMBER m_vecProperty NOTIFY vecPropertyChanged) + Q_PROPERTY(QList<float> vecProperty MEMBER m_vecProperty NOTIFY vecPropertyChanged) signals: void rotationChanged(); @@ -72,7 +72,7 @@ private: QVector4D m_vec4Property; QQuaternion m_quaternionProperty; QVariantList m_listProperty; - QVector<float> m_vecProperty; + QList<float> m_vecProperty; }; @@ -245,7 +245,7 @@ private Q_SLOTS: QVariantList list = QVariantList() << QVariant(1.0f) << QVariant(1.0) << QVariant(1.0f) << QVariant(1.0f) << QVariant(1.0f); QTest::newRow("variantlist") << QByteArrayLiteral("listProperty") << QVariant::fromValue(list) << static_cast<int>(QVariant::List) << 5; - QVector<float> vec(8); + QList<float> vec(8); QTest::newRow("vector") << QByteArrayLiteral("vecProperty") << QVariant::fromValue(vec) << qMetaTypeId<decltype(vec)>() << 8; } diff --git a/tests/auto/animation/qkeyframeanimation/tst_qkeyframeanimation.cpp b/tests/auto/animation/qkeyframeanimation/tst_qkeyframeanimation.cpp index 33bbebc52..0965818ee 100644 --- a/tests/auto/animation/qkeyframeanimation/tst_qkeyframeanimation.cpp +++ b/tests/auto/animation/qkeyframeanimation/tst_qkeyframeanimation.cpp @@ -185,15 +185,9 @@ private Q_SLOTS: keyframes[1].setRotationY(45.0f); keyframes[2].setRotationZ(90.0f); - QVector<float> framePositions; - framePositions.push_back(positions[0]); - framePositions.push_back(positions[1]); - framePositions.push_back(positions[2]); - - QVector<Qt3DCore::QTransform*> frames; - frames.push_back(&keyframes[0]); - frames.push_back(&keyframes[1]); - frames.push_back(&keyframes[2]); + const QList<float> framePositions = { positions[0], positions[1], positions[2] }; + + const QList<Qt3DCore::QTransform*> frames = { &keyframes[0], &keyframes[1], &keyframes[2] }; keyframeAnimation.setFramePositions(framePositions); keyframeAnimation.setKeyframes(frames); diff --git a/tests/auto/animation/qmorphinganimation/tst_qmorphinganimation.cpp b/tests/auto/animation/qmorphinganimation/tst_qmorphinganimation.cpp index f41c8871b..faf6c7416 100644 --- a/tests/auto/animation/qmorphinganimation/tst_qmorphinganimation.cpp +++ b/tests/auto/animation/qmorphinganimation/tst_qmorphinganimation.cpp @@ -38,7 +38,7 @@ class tst_QMorphingAnimation : public QObject bool verifyAttribute(Qt3DCore::QGeometry *geometry, QString name, Qt3DCore::QAttribute *attribute) { - const QVector<Qt3DCore::QAttribute *> attributes = geometry->attributes(); + const QList<Qt3DCore::QAttribute *> attributes = geometry->attributes(); for (const Qt3DCore::QAttribute *attr : attributes) { if (attr->name() == name) { if (attr == attribute) @@ -186,37 +186,14 @@ private Q_SLOTS: morphingAnimation.addMorphTarget(mt2); morphingAnimation.addMorphTarget(mt3); - QVector<float> positions; - QVector<float> weights; - positions.push_back(0.0f); - positions.push_back(1.0f); - positions.push_back(2.0f); - positions.push_back(3.0f); - positions.push_back(4.0f); + const QList<float> positions = { 0.0f, 1.0f, 2.0f, 3.0f, 4.0f }; morphingAnimation.setTargetPositions(positions); - weights.resize(3); - - weights[0] = 1.0f; - weights[1] = 0.0f; - weights[2] = 0.0f; - morphingAnimation.setWeights(0, weights); - weights[0] = 0.0f; - weights[1] = 0.0f; - weights[2] = 0.0f; - morphingAnimation.setWeights(1, weights); - weights[0] = 0.0f; - weights[1] = 1.0f; - weights[2] = 0.0f; - morphingAnimation.setWeights(2, weights); - weights[0] = 0.0f; - weights[1] = 0.0f; - weights[2] = 0.0f; - morphingAnimation.setWeights(3, weights); - weights[0] = 0.0f; - weights[1] = 0.0f; - weights[2] = 1.0f; - morphingAnimation.setWeights(4, weights); + morphingAnimation.setWeights(0, QList<float> { 1.0f, 0.0f, 0.0f }); + morphingAnimation.setWeights(1, QList<float> { 0.0f, 0.0f, 0.0f }); + morphingAnimation.setWeights(2, QList<float> { 0.0f, 1.0f, 0.0f }); + morphingAnimation.setWeights(3, QList<float> { 0.0f, 0.0f, 0.0f }); + morphingAnimation.setWeights(4, QList<float> { 0.0f, 0.0f, 1.0f }); morphingAnimation.setMethod(Qt3DAnimation::QMorphingAnimation::Relative); { diff --git a/tests/auto/animation/skeleton/tst_skeleton.cpp b/tests/auto/animation/skeleton/tst_skeleton.cpp index 3b4b0a429..a17bfcab5 100644 --- a/tests/auto/animation/skeleton/tst_skeleton.cpp +++ b/tests/auto/animation/skeleton/tst_skeleton.cpp @@ -75,7 +75,7 @@ private Q_SLOTS: { // GIVEN Skeleton backendSkeleton; - const QVector<QString> jointNames = { QLatin1String("rootJoint"), + const QList<QString> jointNames = { QLatin1String("rootJoint"), QLatin1String("child1Joint"), QLatin1String("child2Joint") }; @@ -103,11 +103,10 @@ private Q_SLOTS: QCOMPARE(backendSkeleton.jointLocalPoses().size(), 0); // GIVEN - const QVector<QString> names = (QVector<QString>() - << QLatin1String("root") - << QLatin1String("child1") - << QLatin1String("child2")); - const QVector<Sqt> localPoses = (QVector<Sqt>() << Sqt() << Sqt() << Sqt()); + const QList<QString> names = { QLatin1String("root"), + QLatin1String("child1"), + QLatin1String("child2") }; + const QList<Sqt> localPoses = { Sqt(), Sqt(), Sqt() }; // WHEN backendSkeleton.setJointNames(names); @@ -140,12 +139,12 @@ private Q_SLOTS: void checkJointTransforms_data() { QTest::addColumn<Skeleton*>("skeleton"); - QTest::addColumn<QVector<Sqt>>("jointTransforms"); + QTest::addColumn<QList<Sqt>>("jointTransforms"); const int count = 5; auto skeleton = new Skeleton; skeleton->setJointCount(count); - QVector<Sqt> jointTransforms; + QList<Sqt> jointTransforms; jointTransforms.reserve(count); for (int i = 0; i < count; ++i) { const float f = float(i); @@ -166,7 +165,7 @@ private Q_SLOTS: { // GIVEN QFETCH(Skeleton*, skeleton); - QFETCH(QVector<Sqt>, jointTransforms); + QFETCH(QList<Sqt>, jointTransforms); const int count = skeleton->jointCount(); for (int i = 0; i < count; ++i) { diff --git a/tests/auto/core/nodes/tst_nodes.cpp b/tests/auto/core/nodes/tst_nodes.cpp index d925cec15..71d374cd3 100644 --- a/tests/auto/core/nodes/tst_nodes.cpp +++ b/tests/auto/core/nodes/tst_nodes.cpp @@ -207,7 +207,7 @@ signals: protected: QString m_customProperty; MyQNode *m_nodeProperty; - QVector<MyQNode *> m_attributes; + QList<MyQNode *> m_attributes; }; class MyQEntity : public Qt3DCore::QEntity @@ -304,7 +304,7 @@ signals: private: MyQNode *m_nodeProperty; - QVector<MyQNode *> m_attributes; + QList<MyQNode *> m_attributes; }; class MyQComponent : public Qt3DCore::QComponent @@ -363,9 +363,9 @@ public: events.push_back(Event{ change, id}); } - QVector<Qt3DCore::QNodeId> filteredEvents(ChangeType change) const + QList<Qt3DCore::QNodeId> filteredEvents(ChangeType change) const { - QVector<Qt3DCore::QNodeId> result; + QList<Qt3DCore::QNodeId> result; for (const auto &event : events) { if (event.type == change) result.push_back(event.nodeId); @@ -378,7 +378,7 @@ public: Qt3DCore::QNodeId nodeId; }; - mutable QVector<Event> events; + mutable QList<Event> events; mutable QHash<Qt3DCore::QNodeId, Qt3DCore::QNode *> allNodes; private: @@ -1263,8 +1263,8 @@ void tst_Nodes::checkSceneIsSetOnConstructionWithParent() // WHEN Qt3DCore::QEntity *subTreeRoot = new Qt3DCore::QEntity(root.data()); - QVector<Qt3DCore::QEntity *> children; - QVector<Qt3DCore::QComponent *> cmps; + QList<Qt3DCore::QEntity *> children; + QList<Qt3DCore::QComponent *> cmps; children.reserve(5); cmps.reserve(5); for (int i = 0; i < 5; ++i) { diff --git a/tests/auto/core/qentity/tst_qentity.cpp b/tests/auto/core/qentity/tst_qentity.cpp index 4b32c5aac..32880f1a9 100644 --- a/tests/auto/core/qentity/tst_qentity.cpp +++ b/tests/auto/core/qentity/tst_qentity.cpp @@ -522,8 +522,8 @@ void tst_Entity::retrieveSingleComponent() entity1->addComponent(comp2); // WHEN - QVector<MyQComponent*> myQComponentsInEntity = entity1->componentsOfType<MyQComponent>(); - QVector<MyQ2Component*> myQ2ComponentsInEntity = entity1->componentsOfType<MyQ2Component>(); + const QList<MyQComponent *> myQComponentsInEntity = entity1->componentsOfType<MyQComponent>(); + const QList<MyQ2Component *> myQ2ComponentsInEntity = entity1->componentsOfType<MyQ2Component>(); // THEN QVERIFY(myQComponentsInEntity.size() == 2); diff --git a/tests/auto/core/qscene/tst_qscene.cpp b/tests/auto/core/qscene/tst_qscene.cpp index 7285beb1c..1bd2aa3a8 100644 --- a/tests/auto/core/qscene/tst_qscene.cpp +++ b/tests/auto/core/qscene/tst_qscene.cpp @@ -272,7 +272,7 @@ void tst_QScene::addEntityForComponent() // THEN for (int i = 0; i < 10; i++) { - QVector<Qt3DCore::QNodeId> ids = scene->entitiesForComponent(components.at(i)->id()); + const QList<Qt3DCore::QNodeId> ids = scene->entitiesForComponent(components.at(i)->id()); QCOMPARE(ids.count(), 10); } } diff --git a/tests/auto/extras/qcuboidgeometry/tst_qcuboidgeometry.cpp b/tests/auto/extras/qcuboidgeometry/tst_qcuboidgeometry.cpp index 2bfa89601..8102aa2d8 100644 --- a/tests/auto/extras/qcuboidgeometry/tst_qcuboidgeometry.cpp +++ b/tests/auto/extras/qcuboidgeometry/tst_qcuboidgeometry.cpp @@ -197,31 +197,31 @@ private Q_SLOTS: QTest::addColumn<QSize>("yzMeshResolution"); QTest::addColumn<QSize>("xzMeshResolution"); QTest::addColumn<int>("triangleIndex"); - QTest::addColumn<QVector<quint16>>("indices"); - QTest::addColumn<QVector<QVector3D>>("positions"); - QTest::addColumn<QVector<QVector3D>>("normals"); - QTest::addColumn<QVector<QVector2D>>("texCoords"); - QTest::addColumn<QVector<QVector4D>>("tangents"); + QTest::addColumn<QList<quint16>>("indices"); + QTest::addColumn<QList<QVector3D>>("positions"); + QTest::addColumn<QList<QVector3D>>("normals"); + QTest::addColumn<QList<QVector2D>>("texCoords"); + QTest::addColumn<QList<QVector4D>>("tangents"); { const int triangleIndex = 0; - const auto indices = (QVector<quint16>() << 0 << 1 << 2); - const auto positions = (QVector<QVector3D>() - << QVector3D(0.5f, -0.5f, -0.5f) - << QVector3D(0.5f, 0.5f, -0.5f) - << QVector3D(0.5f, -0.5f, 0.5f)); - const auto normals = (QVector<QVector3D>() - << QVector3D(1.0f, 0.0f, 0.0f) - << QVector3D(1.0f, 0.0f, 0.0f) - << QVector3D(1.0f, 0.0f, 0.0f)); - const auto texCoords = (QVector<QVector2D>() - << QVector2D(1.0f, 0.0f) - << QVector2D(1.0f, 1.0f) - << QVector2D(0.0f, 0.0f)); - const auto tangents = (QVector<QVector4D>() - << QVector4D(0.0f, 0.0f, -1.0f, 1.0f) - << QVector4D(0.0f, 0.0f, -1.0f, 1.0f) - << QVector4D(0.0f, 0.0f, -1.0f, 1.0f)); + const QList<quint16> indices = { 0, 1, 2 }; + const QList<QVector3D> positions + = { QVector3D(0.5f, -0.5f, -0.5f), + QVector3D(0.5f, 0.5f, -0.5f), + QVector3D(0.5f, -0.5f, 0.5f) }; + const QList<QVector3D> normals + = { QVector3D(1.0f, 0.0f, 0.0f), + QVector3D(1.0f, 0.0f, 0.0f), + QVector3D(1.0f, 0.0f, 0.0f) }; + const QList<QVector2D> texCoords + = { QVector2D(1.0f, 0.0f), + QVector2D(1.0f, 1.0f), + QVector2D(0.0f, 0.0f) }; + const QList<QVector4D> tangents + = { QVector4D(0.0f, 0.0f, -1.0f, 1.0f), + QVector4D(0.0f, 0.0f, -1.0f, 1.0f), + QVector4D(0.0f, 0.0f, -1.0f, 1.0f) }; QTest::newRow("default_positiveX_firstTriangle") << 1.0f << 1.0f << 1.0f << QSize(2,2) << QSize(2,2) << QSize(2,2) @@ -231,23 +231,23 @@ private Q_SLOTS: { const int triangleIndex = 3; - const auto indices = (QVector<quint16>() << 6 << 5 << 7); - const auto positions = (QVector<QVector3D>() - << QVector3D(-0.5f, -0.5f, -0.5f) - << QVector3D(-0.5f, 0.5f, 0.5f) - << QVector3D(-0.5f, 0.5f, -0.5f)); - const auto normals = (QVector<QVector3D>() - << QVector3D(-1.0f, 0.0f, 0.0f) - << QVector3D(-1.0f, 0.0f, 0.0f) - << QVector3D(-1.0f, 0.0f, 0.0f)); - const auto texCoords = (QVector<QVector2D>() - << QVector2D(0.0f, 0.0f) - << QVector2D(1.0f, 1.0f) - << QVector2D(0.0f, 1.0f)); - const auto tangents = (QVector<QVector4D>() - << QVector4D(0.0f, 0.0f, 1.0f, 1.0f) - << QVector4D(0.0f, 0.0f, 1.0f, 1.0f) - << QVector4D(0.0f, 0.0f, 1.0f, 1.0f)); + const QList<quint16> indices = { 6, 5, 7 }; + const QList<QVector3D> positions + = { QVector3D(-0.5f, -0.5f, -0.5f), + QVector3D(-0.5f, 0.5f, 0.5f), + QVector3D(-0.5f, 0.5f, -0.5f) }; + const QList<QVector3D> normals + = { QVector3D(-1.0f, 0.0f, 0.0f), + QVector3D(-1.0f, 0.0f, 0.0f), + QVector3D(-1.0f, 0.0f, 0.0f) }; + const QList<QVector2D> texCoords + = { QVector2D(0.0f, 0.0f), + QVector2D(1.0f, 1.0f), + QVector2D(0.0f, 1.0f) }; + const QList<QVector4D> tangents + = { QVector4D(0.0f, 0.0f, 1.0f, 1.0f), + QVector4D(0.0f, 0.0f, 1.0f, 1.0f), + QVector4D(0.0f, 0.0f, 1.0f, 1.0f) }; QTest::newRow("default_negativeX_lastTriangle") << 1.0f << 1.0f << 1.0f << QSize(2,2) << QSize(2,2) << QSize(2,2) @@ -257,23 +257,23 @@ private Q_SLOTS: { const int triangleIndex = 4; - const auto indices = (QVector<quint16>() << 8 << 9 << 10); - const auto positions = (QVector<QVector3D>() - << QVector3D(-0.5f, 0.5f, 0.5f) - << QVector3D(0.5f, 0.5f, 0.5f) - << QVector3D(-0.5f, 0.5f, -0.5f)); - const auto normals = (QVector<QVector3D>() - << QVector3D(0.0f, 1.0f, 0.0f) - << QVector3D(0.0f, 1.0f, 0.0f) - << QVector3D(0.0f, 1.0f, 0.0f)); - const auto texCoords = (QVector<QVector2D>() - << QVector2D(0.0f, 0.0f) - << QVector2D(1.0f, 0.0f) - << QVector2D(0.0f, 1.0f)); - const auto tangents = (QVector<QVector4D>() - << QVector4D(1.0f, 0.0f, 0.0f, 1.0f) - << QVector4D(1.0f, 0.0f, 0.0f, 1.0f) - << QVector4D(1.0f, 0.0f, 0.0f, 1.0f)); + const QList<quint16> indices = { 8, 9, 10 }; + const QList<QVector3D> positions + = { QVector3D(-0.5f, 0.5f, 0.5f), + QVector3D(0.5f, 0.5f, 0.5f), + QVector3D(-0.5f, 0.5f, -0.5f) }; + const QList<QVector3D> normals + = { QVector3D(0.0f, 1.0f, 0.0f), + QVector3D(0.0f, 1.0f, 0.0f), + QVector3D(0.0f, 1.0f, 0.0f) }; + const QList<QVector2D> texCoords + = { QVector2D(0.0f, 0.0f), + QVector2D(1.0f, 0.0f), + QVector2D(0.0f, 1.0f) }; + const QList<QVector4D> tangents + = { QVector4D(1.0f, 0.0f, 0.0f, 1.0f), + QVector4D(1.0f, 0.0f, 0.0f, 1.0f), + QVector4D(1.0f, 0.0f, 0.0f, 1.0f) }; QTest::newRow("default_positiveY_firstTriangle") << 1.0f << 1.0f << 1.0f << QSize(2,2) << QSize(2,2) << QSize(2,2) @@ -283,23 +283,23 @@ private Q_SLOTS: { const int triangleIndex = 7; - const auto indices = (QVector<quint16>() << 14 << 13 << 15); - const auto positions = (QVector<QVector3D>() - << QVector3D(-0.5f, -0.5f, 0.5f) - << QVector3D(0.5f, -0.5f, -0.5f) - << QVector3D(0.5f, -0.5f, 0.5f)); - const auto normals = (QVector<QVector3D>() - << QVector3D(0.0f, -1.0f, 0.0f) - << QVector3D(0.0f, -1.0f, 0.0f) - << QVector3D(0.0f, -1.0f, 0.0f)); - const auto texCoords = (QVector<QVector2D>() - << QVector2D(0.0f, 1.0f) - << QVector2D(1.0f, 0.0f) - << QVector2D(1.0f, 1.0f)); - const auto tangents = (QVector<QVector4D>() - << QVector4D(1.0f, 0.0f, 0.0f, 1.0f) - << QVector4D(1.0f, 0.0f, 0.0f, 1.0f) - << QVector4D(1.0f, 0.0f, 0.0f, 1.0f)); + const QList<quint16> indices = { 14, 13, 15 }; + const QList<QVector3D> positions + = { QVector3D(-0.5f, -0.5f, 0.5f), + QVector3D(0.5f, -0.5f, -0.5f), + QVector3D(0.5f, -0.5f, 0.5f) }; + const QList<QVector3D> normals + = { QVector3D(0.0f, -1.0f, 0.0f), + QVector3D(0.0f, -1.0f, 0.0f), + QVector3D(0.0f, -1.0f, 0.0f) }; + const QList<QVector2D> texCoords + = { QVector2D(0.0f, 1.0f), + QVector2D(1.0f, 0.0f), + QVector2D(1.0f, 1.0f) }; + const QList<QVector4D> tangents + = { QVector4D(1.0f, 0.0f, 0.0f, 1.0f), + QVector4D(1.0f, 0.0f, 0.0f, 1.0f), + QVector4D(1.0f, 0.0f, 0.0f, 1.0f) }; QTest::newRow("default_negativeY_lastTriangle") << 1.0f << 1.0f << 1.0f << QSize(2,2) << QSize(2,2) << QSize(2,2) @@ -309,23 +309,23 @@ private Q_SLOTS: { const int triangleIndex = 8; - const auto indices = (QVector<quint16>() << 16 << 17 << 18); - const auto positions = (QVector<QVector3D>() - << QVector3D(-0.5f, -0.5f, 0.5f) - << QVector3D(0.5f, -0.5f, 0.5f) - << QVector3D(-0.5f, 0.5f, 0.5f)); - const auto normals = (QVector<QVector3D>() - << QVector3D(0.0f, 0.0f, 1.0f) - << QVector3D(0.0f, 0.0f, 1.0f) - << QVector3D(0.0f, 0.0f, 1.0f)); - const auto texCoords = (QVector<QVector2D>() - << QVector2D(0.0f, 0.0f) - << QVector2D(1.0f, 0.0f) - << QVector2D(0.0f, 1.0f)); - const auto tangents = (QVector<QVector4D>() - << QVector4D(1.0f, 0.0f, 0.0f, 1.0f) - << QVector4D(1.0f, 0.0f, 0.0f, 1.0f) - << QVector4D(1.0f, 0.0f, 0.0f, 1.0f)); + const QList<quint16> indices = { 16, 17, 18 }; + const QList<QVector3D> positions + = { QVector3D(-0.5f, -0.5f, 0.5f), + QVector3D(0.5f, -0.5f, 0.5f), + QVector3D(-0.5f, 0.5f, 0.5f) }; + const QList<QVector3D> normals + = { QVector3D(0.0f, 0.0f, 1.0f), + QVector3D(0.0f, 0.0f, 1.0f), + QVector3D(0.0f, 0.0f, 1.0f) }; + const QList<QVector2D> texCoords + = { QVector2D(0.0f, 0.0f), + QVector2D(1.0f, 0.0f), + QVector2D(0.0f, 1.0f) }; + const QList<QVector4D> tangents + = { QVector4D(1.0f, 0.0f, 0.0f, 1.0f), + QVector4D(1.0f, 0.0f, 0.0f, 1.0f), + QVector4D(1.0f, 0.0f, 0.0f, 1.0f) }; QTest::newRow("default_positiveZ_firstTriangle") << 1.0f << 1.0f << 1.0f << QSize(2,2) << QSize(2,2) << QSize(2,2) @@ -335,23 +335,23 @@ private Q_SLOTS: { const int triangleIndex = 11; - const auto indices = (QVector<quint16>() << 22 << 21 << 23); - const auto positions = (QVector<QVector3D>() - << QVector3D(0.5f, 0.5f, -0.5f) - << QVector3D(-0.5f, -0.5f, -0.5f) - << QVector3D(-0.5f, 0.5f, -0.5f)); - const auto normals = (QVector<QVector3D>() - << QVector3D(0.0f, 0.0f, -1.0f) - << QVector3D(0.0f, 0.0f, -1.0f) - << QVector3D(0.0f, 0.0f, -1.0f)); - const auto texCoords = (QVector<QVector2D>() - << QVector2D(0.0f, 1.0f) - << QVector2D(1.0f, 0.0f) - << QVector2D(1.0f, 1.0f)); - const auto tangents = (QVector<QVector4D>() - << QVector4D(-1.0f, 0.0f, 0.0f, 1.0f) - << QVector4D(-1.0f, 0.0f, 0.0f, 1.0f) - << QVector4D(-1.0f, 0.0f, 0.0f, 1.0f)); + const QList<quint16> indices = { 22, 21, 23 }; + const QList<QVector3D> positions + = { QVector3D(0.5f, 0.5f, -0.5f), + QVector3D(-0.5f, -0.5f, -0.5f), + QVector3D(-0.5f, 0.5f, -0.5f) }; + const QList<QVector3D> normals + = { QVector3D(0.0f, 0.0f, -1.0f), + QVector3D(0.0f, 0.0f, -1.0f), + QVector3D(0.0f, 0.0f, -1.0f) }; + const QList<QVector2D> texCoords + = { QVector2D(0.0f, 1.0f), + QVector2D(1.0f, 0.0f), + QVector2D(1.0f, 1.0f) }; + const QList<QVector4D> tangents + = { QVector4D(-1.0f, 0.0f, 0.0f, 1.0f), + QVector4D(-1.0f, 0.0f, 0.0f, 1.0f), + QVector4D(-1.0f, 0.0f, 0.0f, 1.0f) }; QTest::newRow("default_negativeZ_lastTriangle") << 1.0f << 1.0f << 1.0f << QSize(2,2) << QSize(2,2) << QSize(2,2) @@ -361,23 +361,23 @@ private Q_SLOTS: { const int triangleIndex = 0; - const auto indices = (QVector<quint16>() << 0 << 1 << 2); - const auto positions = (QVector<QVector3D>() - << QVector3D(1.0f, -1.5f, -2.5f) - << QVector3D(1.0f, 1.5f, -2.5f) - << QVector3D(1.0f, -1.5f, -1.25f)); - const auto normals = (QVector<QVector3D>() - << QVector3D(1.0f, 0.0f, 0.0f) - << QVector3D(1.0f, 0.0f, 0.0f) - << QVector3D(1.0f, 0.0f, 0.0f)); - const auto texCoords = (QVector<QVector2D>() - << QVector2D(1.0f, 0.0f) - << QVector2D(1.0f, 1.0f) - << QVector2D(0.75f, 0.0f)); - const auto tangents = (QVector<QVector4D>() - << QVector4D(0.0f, 0.0f, -1.0f, 1.0f) - << QVector4D(0.0f, 0.0f, -1.0f, 1.0f) - << QVector4D(0.0f, 0.0f, -1.0f, 1.0f)); + const QList<quint16> indices = { 0, 1, 2 }; + const QList<QVector3D> positions + = { QVector3D(1.0f, -1.5f, -2.5f), + QVector3D(1.0f, 1.5f, -2.5f), + QVector3D(1.0f, -1.5f, -1.25f) }; + const QList<QVector3D> normals + = { QVector3D(1.0f, 0.0f, 0.0f), + QVector3D(1.0f, 0.0f, 0.0f), + QVector3D(1.0f, 0.0f, 0.0f) }; + const QList<QVector2D> texCoords + = { QVector2D(1.0f, 0.0f), + QVector2D(1.0f, 1.0f), + QVector2D(0.75f, 0.0f) }; + const QList<QVector4D> tangents + = { QVector4D(0.0f, 0.0f, -1.0f, 1.0f), + QVector4D(0.0f, 0.0f, -1.0f, 1.0f), + QVector4D(0.0f, 0.0f, -1.0f, 1.0f) }; QTest::newRow("default_positiveX_firstTriangle_nonSymmetric") << 2.0f << 3.0f << 5.0f << QSize(2,3) << QSize(2,5) << QSize(2,9) @@ -387,23 +387,23 @@ private Q_SLOTS: { const int triangleIndex = 15; - const auto indices = (QVector<quint16>() << 18 << 17 << 19); - const auto positions = (QVector<QVector3D>() - << QVector3D(-1.0f, -1.5f, -2.5f) - << QVector3D(-1.0f, 1.5f, -1.25f) - << QVector3D(-1.0f, 1.5f, -2.5f)); - const auto normals = (QVector<QVector3D>() - << QVector3D(-1.0f, 0.0f, 0.0f) - << QVector3D(-1.0f, 0.0f, 0.0f) - << QVector3D(-1.0f, 0.0f, 0.0f)); - const auto texCoords = (QVector<QVector2D>() - << QVector2D(0.0f, 0.0f) - << QVector2D(0.25f, 1.0f) - << QVector2D(0.0f, 1.0f)); - const auto tangents = (QVector<QVector4D>() - << QVector4D(0.0f, 0.0f, 1.0f, 1.0f) - << QVector4D(0.0f, 0.0f, 1.0f, 1.0f) - << QVector4D(0.0f, 0.0f, 1.0f, 1.0f)); + const QList<quint16> indices = { 18, 17, 19 }; + const QList<QVector3D> positions + = { QVector3D(-1.0f, -1.5f, -2.5f), + QVector3D(-1.0f, 1.5f, -1.25f), + QVector3D(-1.0f, 1.5f, -2.5f) }; + const QList<QVector3D> normals + = { QVector3D(-1.0f, 0.0f, 0.0f), + QVector3D(-1.0f, 0.0f, 0.0f), + QVector3D(-1.0f, 0.0f, 0.0f) }; + const QList<QVector2D> texCoords + = { QVector2D(0.0f, 0.0f), + QVector2D(0.25f, 1.0f), + QVector2D(0.0f, 1.0f) }; + const QList<QVector4D> tangents + = { QVector4D(0.0f, 0.0f, 1.0f, 1.0f), + QVector4D(0.0f, 0.0f, 1.0f, 1.0f), + QVector4D(0.0f, 0.0f, 1.0f, 1.0f) }; QTest::newRow("default_negativeX_lastTriangle_nonSymmetric") << 2.0f << 3.0f << 5.0f << QSize(2,3) << QSize(2,5) << QSize(2,9) @@ -413,23 +413,23 @@ private Q_SLOTS: { const int triangleIndex = 16; - const auto indices = (QVector<quint16>() << 20 << 21 << 22); - const auto positions = (QVector<QVector3D>() - << QVector3D(-1.0f, 1.5f, 2.5f) - << QVector3D(1.0f, 1.5f, 2.5f) - << QVector3D(-1.0f, 1.5f, 1.875f)); - const auto normals = (QVector<QVector3D>() - << QVector3D(0.0f, 1.0f, 0.0f) - << QVector3D(0.0f, 1.0f, 0.0f) - << QVector3D(0.0f, 1.0f, 0.0f)); - const auto texCoords = (QVector<QVector2D>() - << QVector2D(0.0f, 0.0f) - << QVector2D(1.0f, 0.0f) - << QVector2D(0.0f, 0.125f)); - const auto tangents = (QVector<QVector4D>() - << QVector4D(1.0f, 0.0f, 0.0f, 1.0f) - << QVector4D(1.0f, 0.0f, 0.0f, 1.0f) - << QVector4D(1.0f, 0.0f, 0.0f, 1.0f)); + const QList<quint16> indices = { 20, 21, 22 }; + const QList<QVector3D> positions + = { QVector3D(-1.0f, 1.5f, 2.5f), + QVector3D(1.0f, 1.5f, 2.5f), + QVector3D(-1.0f, 1.5f, 1.875f) }; + const QList<QVector3D> normals + = { QVector3D(0.0f, 1.0f, 0.0f), + QVector3D(0.0f, 1.0f, 0.0f), + QVector3D(0.0f, 1.0f, 0.0f) }; + const QList<QVector2D> texCoords + = { QVector2D(0.0f, 0.0f), + QVector2D(1.0f, 0.0f), + QVector2D(0.0f, 0.125f) }; + const QList<QVector4D> tangents + = { QVector4D(1.0f, 0.0f, 0.0f, 1.0f), + QVector4D(1.0f, 0.0f, 0.0f, 1.0f), + QVector4D(1.0f, 0.0f, 0.0f, 1.0f) }; QTest::newRow("default_positiveY_firstTriangle_nonSymmetric") << 2.0f << 3.0f << 5.0f << QSize(2,3) << QSize(2,5) << QSize(2,9) @@ -439,23 +439,23 @@ private Q_SLOTS: { const int triangleIndex = 47; - const auto indices = (QVector<quint16>() << 54 << 53 << 55); - const auto positions = (QVector<QVector3D>() - << QVector3D(-1.0f, -1.5f, 2.5f) - << QVector3D(1.0f, -1.5f, 1.875f) - << QVector3D(1.0f, -1.5f, 2.5f)); - const auto normals = (QVector<QVector3D>() - << QVector3D(0.0f, -1.0f, 0.0f) - << QVector3D(0.0f, -1.0f, 0.0f) - << QVector3D(0.0f, -1.0f, 0.0f)); - const auto texCoords = (QVector<QVector2D>() - << QVector2D(0.0f, 1.0f) - << QVector2D(1.0f, 0.875f) - << QVector2D(1.0f, 1.0f)); - const auto tangents = (QVector<QVector4D>() - << QVector4D(1.0f, 0.0f, 0.0f, 1.0f) - << QVector4D(1.0f, 0.0f, 0.0f, 1.0f) - << QVector4D(1.0f, 0.0f, 0.0f, 1.0f)); + const QList<quint16> indices = { 54, 53, 55 }; + const QList<QVector3D> positions + = { QVector3D(-1.0f, -1.5f, 2.5f), + QVector3D(1.0f, -1.5f, 1.875f), + QVector3D(1.0f, -1.5f, 2.5f) }; + const QList<QVector3D> normals + = { QVector3D(0.0f, -1.0f, 0.0f), + QVector3D(0.0f, -1.0f, 0.0f), + QVector3D(0.0f, -1.0f, 0.0f) }; + const QList<QVector2D> texCoords + = { QVector2D(0.0f, 1.0f), + QVector2D(1.0f, 0.875f), + QVector2D(1.0f, 1.0f) }; + const QList<QVector4D> tangents + = { QVector4D(1.0f, 0.0f, 0.0f, 1.0f), + QVector4D(1.0f, 0.0f, 0.0f, 1.0f), + QVector4D(1.0f, 0.0f, 0.0f, 1.0f) }; QTest::newRow("default_negativeY_lastTriangle_nonSymmetric") << 2.0f << 3.0f << 5.0f << QSize(2,3) << QSize(2,5) << QSize(2,9) @@ -465,23 +465,23 @@ private Q_SLOTS: { const int triangleIndex = 48; - const auto indices = (QVector<quint16>() << 56 << 57 << 58); - const auto positions = (QVector<QVector3D>() - << QVector3D(-1.0f, -1.5f, 2.5f) - << QVector3D(1.0f, -1.5f, 2.5f) - << QVector3D(-1.0f, 0.0f, 2.5f)); - const auto normals = (QVector<QVector3D>() - << QVector3D(0.0f, 0.0f, 1.0f) - << QVector3D(0.0f, 0.0f, 1.0f) - << QVector3D(0.0f, 0.0f, 1.0f)); - const auto texCoords = (QVector<QVector2D>() - << QVector2D(0.0f, 0.0f) - << QVector2D(1.0f, 0.0f) - << QVector2D(0.0f, 0.5f)); - const auto tangents = (QVector<QVector4D>() - << QVector4D(1.0f, 0.0f, 0.0f, 1.0f) - << QVector4D(1.0f, 0.0f, 0.0f, 1.0f) - << QVector4D(1.0f, 0.0f, 0.0f, 1.0f)); + const QList<quint16> indices = { 56, 57, 58 }; + const QList<QVector3D> positions + = { QVector3D(-1.0f, -1.5f, 2.5f), + QVector3D(1.0f, -1.5f, 2.5f), + QVector3D(-1.0f, 0.0f, 2.5f) }; + const QList<QVector3D> normals + = { QVector3D(0.0f, 0.0f, 1.0f), + QVector3D(0.0f, 0.0f, 1.0f), + QVector3D(0.0f, 0.0f, 1.0f) }; + const QList<QVector2D> texCoords + = { QVector2D(0.0f, 0.0f), + QVector2D(1.0f, 0.0f), + QVector2D(0.0f, 0.5f) }; + const QList<QVector4D> tangents + = { QVector4D(1.0f, 0.0f, 0.0f, 1.0f), + QVector4D(1.0f, 0.0f, 0.0f, 1.0f), + QVector4D(1.0f, 0.0f, 0.0f, 1.0f) }; QTest::newRow("default_positiveZ_firstTriangle_nonSymmetric") << 2.0f << 3.0f << 5.0f << QSize(2,3) << QSize(2,5) << QSize(2,9) @@ -491,23 +491,23 @@ private Q_SLOTS: { const int triangleIndex = 55; - const auto indices = (QVector<quint16>() << 66 << 65 << 67); - const auto positions = (QVector<QVector3D>() - << QVector3D(1.0f, 1.5f, -2.5f) - << QVector3D(-1.0f, 0.0f, -2.5f) - << QVector3D(-1.0f, 1.5f, -2.5f)); - const auto normals = (QVector<QVector3D>() - << QVector3D(0.0f, 0.0f, -1.0f) - << QVector3D(0.0f, 0.0f, -1.0f) - << QVector3D(0.0f, 0.0f, -1.0f)); - const auto texCoords = (QVector<QVector2D>() - << QVector2D(0.0f, 1.0f) - << QVector2D(1.0f, 0.5f) - << QVector2D(1.0f, 1.0f)); - const auto tangents = (QVector<QVector4D>() - << QVector4D(-1.0f, 0.0f, 0.0f, 1.0f) - << QVector4D(-1.0f, 0.0f, 0.0f, 1.0f) - << QVector4D(-1.0f, 0.0f, 0.0f, 1.0f)); + const QList<quint16> indices = { 66, 65, 67 }; + const QList<QVector3D> positions + = { QVector3D(1.0f, 1.5f, -2.5f), + QVector3D(-1.0f, 0.0f, -2.5f), + QVector3D(-1.0f, 1.5f, -2.5f) }; + const QList<QVector3D> normals + = { QVector3D(0.0f, 0.0f, -1.0f), + QVector3D(0.0f, 0.0f, -1.0f), + QVector3D(0.0f, 0.0f, -1.0f) }; + const QList<QVector2D> texCoords + = { QVector2D(0.0f, 1.0f), + QVector2D(1.0f, 0.5f), + QVector2D(1.0f, 1.0f) }; + const QList<QVector4D> tangents + = { QVector4D(-1.0f, 0.0f, 0.0f, 1.0f), + QVector4D(-1.0f, 0.0f, 0.0f, 1.0f), + QVector4D(-1.0f, 0.0f, 0.0f, 1.0f) }; QTest::newRow("default_negativeZ_lastTriangle_nonSymmetric") << 2.0f << 3.0f << 5.0f << QSize(2,3) << QSize(2,5) << QSize(2,9) @@ -520,7 +520,7 @@ private Q_SLOTS: { // GIVEN Qt3DExtras::QCuboidGeometry geometry; - const QVector<Qt3DCore::QAttribute *> attributes = geometry.attributes(); + const QList<Qt3DCore::QAttribute *> attributes = geometry.attributes(); Qt3DCore::QAttribute *positionAttribute = geometry.positionAttribute(); Qt3DCore::QAttribute *normalAttribute = geometry.normalAttribute(); Qt3DCore::QAttribute *texCoordAttribute = geometry.texCoordAttribute(); @@ -554,11 +554,11 @@ private Q_SLOTS: // Check specific indices and vertex attributes of triangle under test QFETCH(int, triangleIndex); - QFETCH(QVector<quint16>, indices); - QFETCH(QVector<QVector3D>, positions); - QFETCH(QVector<QVector3D>, normals); - QFETCH(QVector<QVector2D>, texCoords); - QFETCH(QVector<QVector4D>, tangents); + QFETCH(QList<quint16>, indices); + QFETCH(QList<QVector3D>, positions); + QFETCH(QList<QVector3D>, normals); + QFETCH(QList<QVector2D>, texCoords); + QFETCH(QList<QVector4D>, tangents); int i = 0; for (auto index : indices) { diff --git a/tests/auto/extras/qtext2dentity/tst_qtext2dentity.cpp b/tests/auto/extras/qtext2dentity/tst_qtext2dentity.cpp index 0195d962b..08da931fc 100644 --- a/tests/auto/extras/qtext2dentity/tst_qtext2dentity.cpp +++ b/tests/auto/extras/qtext2dentity/tst_qtext2dentity.cpp @@ -54,10 +54,10 @@ #include <Qt3DQuick/QQmlAspectEngine> #include <Qt3DCore/private/qnode_p.h> -QVector<Qt3DCore::QNode *>lookupNodeByClassName(Qt3DCore::QNode *root, const QString &className) +QList<Qt3DCore::QNode *>lookupNodeByClassName(Qt3DCore::QNode *root, const QString &className) { auto children = root->childNodes(); - QVector<Qt3DCore::QNode *> childrenList; + QList<Qt3DCore::QNode *> childrenList; for (auto i : children) { if (i->metaObject()->className() == className) childrenList << i; diff --git a/tests/auto/extras/qtorusgeometry/tst_qtorusgeometry.cpp b/tests/auto/extras/qtorusgeometry/tst_qtorusgeometry.cpp index 08afd09e3..e05a0669b 100644 --- a/tests/auto/extras/qtorusgeometry/tst_qtorusgeometry.cpp +++ b/tests/auto/extras/qtorusgeometry/tst_qtorusgeometry.cpp @@ -157,11 +157,11 @@ private Q_SLOTS: QTest::addColumn<float>("radius"); QTest::addColumn<float>("minorRadius"); QTest::addColumn<int>("triangleIndex"); - QTest::addColumn<QVector<quint16>>("indices"); - QTest::addColumn<QVector<QVector3D>>("positions"); - QTest::addColumn<QVector<QVector3D>>("normals"); - QTest::addColumn<QVector<QVector2D>>("texCoords"); - QTest::addColumn<QVector<QVector4D>>("tangents"); + QTest::addColumn<QList<quint16>>("indices"); + QTest::addColumn<QList<QVector3D>>("positions"); + QTest::addColumn<QList<QVector3D>>("normals"); + QTest::addColumn<QList<QVector2D>>("texCoords"); + QTest::addColumn<QList<QVector4D>>("tangents"); { // Torus properties @@ -192,7 +192,7 @@ private Q_SLOTS: // The triangle and indices const int triangleIndex = 0; - const auto indices = (QVector<quint16>() << 0 << 1 << 9); + const QList<quint16> indices = { 0, 1, 9 }; // Calculate attributes for vertices A, B, and C of the triangle const float rA = radius + minorRadius * cosv0; @@ -202,22 +202,22 @@ private Q_SLOTS: const auto posA = QVector3D(rA * cosu0, rA * sinu0, minorRadius * sinv0); const auto posB = QVector3D(rB * cosu0, rB * sinu0, minorRadius * sinv1); const auto posC = QVector3D(rC * cosu1, rC * sinu1, minorRadius * sinv0); - const auto positions = (QVector<QVector3D>() << posA << posB << posC); + const QList<QVector3D> positions = { posA, posB, posC }; const auto nA = QVector3D(cosv0 * cosu0, cosv0 * sinu0, sinv0).normalized(); const auto nB = QVector3D(cosv1 * cosu0, cosv1 * sinu0, sinv1).normalized(); const auto nC = QVector3D(cosv0 * cosu1, cosv0 * sinu1, sinv0).normalized(); - const auto normals = (QVector<QVector3D>() << nA << nB << nC); + const QList<QVector3D> normals = { nA, nB, nC }; const auto tcA = QVector2D(u0, v0) / float(2.0 * M_PI); const auto tcB = QVector2D(u0, v1) / float(2.0 * M_PI); const auto tcC = QVector2D(u1, v0) / float(2.0 * M_PI); - const auto texCoords = (QVector<QVector2D>() << tcA << tcB << tcC); + const QList<QVector2D> texCoords = { tcA, tcB, tcC }; const auto tA = QVector4D(-sinu0, cosu0, 0.0f, 1.0f); const auto tB = QVector4D(-sinu0, cosu0, 0.0f, 1.0f); const auto tC = QVector4D(-sinu1, cosu1, 0.0f, 1.0f); - const auto tangents = (QVector<QVector4D>() << tA << tB << tC); + const QList<QVector4D> tangents = { tA, tB, tC }; // Add the row QTest::newRow("8rings_8slices_firstTriangle") @@ -260,7 +260,7 @@ private Q_SLOTS: // The triangle and indices const int triangleIndex = 127; - const auto indices = (QVector<quint16>() << 71 << 80 << 79); + const QList<quint16> indices = { 71, 80, 79 }; // Calculate attributes for vertices A, B, and C of the triangle const float rA = radius + minorRadius * cosv1; @@ -270,22 +270,22 @@ private Q_SLOTS: const auto posA = QVector3D(rA * cosu0, rA * sinu0, minorRadius * sinv1); const auto posB = QVector3D(rB * cosu1, rB * sinu1, minorRadius * sinv1); const auto posC = QVector3D(rC * cosu1, rC * sinu1, minorRadius * sinv0); - const auto positions = (QVector<QVector3D>() << posA << posB << posC); + const QList<QVector3D> positions = { posA, posB, posC }; const auto nA = QVector3D(cosv1 * cosu0, cosv1 * sinu0, sinv1).normalized(); const auto nB = QVector3D(cosv1 * cosu1, cosv1 * sinu1, sinv1).normalized(); const auto nC = QVector3D(cosv0 * cosu1, cosv0 * sinu1, sinv0).normalized(); - const auto normals = (QVector<QVector3D>() << nA << nB << nC); + const QList<QVector3D> normals = { nA, nB, nC }; const auto tcA = QVector2D(u0, v1) / float(2.0 * M_PI); const auto tcB = QVector2D(u1, v1) / float(2.0 * M_PI); const auto tcC = QVector2D(u1, v0) / float(2.0 * M_PI); - const auto texCoords = (QVector<QVector2D>() << tcA << tcB << tcC); + const QList<QVector2D> texCoords = { tcA, tcB, tcC }; const auto tA = QVector4D(-sinu0, cosu1, 0.0f, 1.0f); const auto tB = QVector4D(-sinu1, cosu1, 0.0f, 1.0f); const auto tC = QVector4D(-sinu1, cosu1, 0.0f, 1.0f); - const auto tangents = (QVector<QVector4D>() << tA << tB << tC); + const QList<QVector4D> tangents = { tA, tB, tC }; // Add the row QTest::newRow("8rings_8slices_lastTriangle") @@ -299,7 +299,7 @@ private Q_SLOTS: { // GIVEN Qt3DExtras::QTorusGeometry geometry; - const QVector<Qt3DCore::QAttribute *> attributes = geometry.attributes(); + const QList<Qt3DCore::QAttribute *> attributes = geometry.attributes(); Qt3DCore::QAttribute *positionAttribute = geometry.positionAttribute(); Qt3DCore::QAttribute *normalAttribute = geometry.normalAttribute(); Qt3DCore::QAttribute *texCoordAttribute = geometry.texCoordAttribute(); @@ -329,11 +329,11 @@ private Q_SLOTS: // Check specific indices and vertex attributes of triangle under test QFETCH(int, triangleIndex); - QFETCH(QVector<quint16>, indices); - QFETCH(QVector<QVector3D>, positions); - QFETCH(QVector<QVector3D>, normals); - QFETCH(QVector<QVector2D>, texCoords); -// QFETCH(QVector<QVector4D>, tangents); + QFETCH(QList<quint16>, indices); + QFETCH(QList<QVector3D>, positions); + QFETCH(QList<QVector3D>, normals); + QFETCH(QList<QVector2D>, texCoords); +// QFETCH(QList<QVector4D>, tangents); int i = 0; for (auto index : indices) { diff --git a/tests/auto/input/actioninput/tst_actioninput.cpp b/tests/auto/input/actioninput/tst_actioninput.cpp index 3c9918da0..1babf12bf 100644 --- a/tests/auto/input/actioninput/tst_actioninput.cpp +++ b/tests/auto/input/actioninput/tst_actioninput.cpp @@ -45,7 +45,7 @@ private Q_SLOTS: Qt3DInput::QActionInput actionInput; TestDevice sourceDevice; - actionInput.setButtons(QVector<int>() << (1 << 8)); + actionInput.setButtons(QList<int> { 1 << 8 }); actionInput.setSourceDevice(&sourceDevice); // WHEN @@ -73,7 +73,7 @@ private Q_SLOTS: Qt3DInput::QActionInput actionInput; TestDevice sourceDevice; - actionInput.setButtons(QVector<int>() << (1 << 8)); + actionInput.setButtons(QList<int> { 1 << 8 }); actionInput.setSourceDevice(&sourceDevice); // WHEN @@ -94,11 +94,11 @@ private Q_SLOTS: simulateInitializationSync(&actionInput, &backendActionInput); // WHEN - actionInput.setButtons(QVector<int>() << 64); + actionInput.setButtons(QList<int> { 64 }); backendActionInput.syncFromFrontEnd(&actionInput, false); // THEN - QCOMPARE(backendActionInput.buttons(), QVector<int>() << 64); + QCOMPARE(backendActionInput.buttons(), QList<int> { 64 }); // WHEN actionInput.setEnabled(false); @@ -128,7 +128,7 @@ private Q_SLOTS: Qt3DInput::Input::ActionInput backendActionInput; Qt3DInput::QActionInput actionInput; actionInput.setEnabled(true); - actionInput.setButtons(QVector<int>() << Qt::Key_Space << Qt::Key_Return); + actionInput.setButtons(QList<int> { Qt::Key_Space, Qt::Key_Return }); actionInput.setSourceDevice(device); simulateInitializationSync(&actionInput, &backendActionInput); @@ -181,7 +181,7 @@ private Q_SLOTS: Qt3DInput::Input::ActionInput backendActionInput; Qt3DInput::QActionInput actionInput; actionInput.setEnabled(false); - actionInput.setButtons(QVector<int>() << Qt::Key_Space << Qt::Key_Return); + actionInput.setButtons(QList<int> { Qt::Key_Space, Qt::Key_Return }); actionInput.setSourceDevice(device); simulateInitializationSync(&actionInput, &backendActionInput); diff --git a/tests/auto/input/axisaccumulatorjob/tst_axisaccumulatorjob.cpp b/tests/auto/input/axisaccumulatorjob/tst_axisaccumulatorjob.cpp index 9a016b8fe..65a2ba82e 100644 --- a/tests/auto/input/axisaccumulatorjob/tst_axisaccumulatorjob.cpp +++ b/tests/auto/input/axisaccumulatorjob/tst_axisaccumulatorjob.cpp @@ -65,7 +65,7 @@ private Q_SLOTS: // Hook up a bunch of accumulators to this axis Qt3DInput::Input::AxisAccumulatorManager axisAccumulatorManager; - QVector<Qt3DInput::Input::AxisAccumulator *> accumulators; + QList<Qt3DInput::Input::AxisAccumulator *> accumulators; for (int i = 0; i < 10; ++i) { auto axisAccumulator = new Qt3DInput::QAxisAccumulator; Qt3DInput::Input::AxisAccumulator *backendAxisAccumulator diff --git a/tests/auto/input/buttonaxisinput/tst_buttonaxisinput.cpp b/tests/auto/input/buttonaxisinput/tst_buttonaxisinput.cpp index e315ed1dc..7aaf25dc9 100644 --- a/tests/auto/input/buttonaxisinput/tst_buttonaxisinput.cpp +++ b/tests/auto/input/buttonaxisinput/tst_buttonaxisinput.cpp @@ -49,7 +49,7 @@ private Q_SLOTS: Qt3DInput::QButtonAxisInput axisInput; TestDevice sourceDevice; - axisInput.setButtons(QVector<int>() << (1 << 8)); + axisInput.setButtons(QList<int> { 1 << 8 }); axisInput.setScale(0.5f); axisInput.setAcceleration(0.42f); axisInput.setDeceleration(0.43f); @@ -91,7 +91,7 @@ private Q_SLOTS: Qt3DInput::QButtonAxisInput axisInput; TestDevice sourceDevice; - axisInput.setButtons(QVector<int>() << (1 << 8)); + axisInput.setButtons(QList<int> { 1 << 8 }); axisInput.setScale(0.5f); axisInput.setSourceDevice(&sourceDevice); @@ -118,11 +118,11 @@ private Q_SLOTS: simulateInitializationSync(&axisInput, &backendAxisInput); // WHEN - axisInput.setButtons(QVector<int>() << 64); + axisInput.setButtons(QList<int> { 64 }); backendAxisInput.syncFromFrontEnd(&axisInput, false); // THEN - QCOMPARE(backendAxisInput.buttons(), QVector<int>() << 64); + QCOMPARE(backendAxisInput.buttons(), QList<int> { 64 }); // WHEN axisInput.setScale(0.5f); @@ -189,7 +189,7 @@ private Q_SLOTS: Qt3DInput::Input::ButtonAxisInput backendAxisInput; Qt3DInput::QButtonAxisInput axisInput; axisInput.setEnabled(true); - axisInput.setButtons(QVector<int>() << Qt::Key_Space); + axisInput.setButtons(QList<int> { Qt::Key_Space }); axisInput.setScale(-1.0f); axisInput.setAcceleration(0.15f); axisInput.setDeceleration(0.3f); @@ -290,7 +290,7 @@ private Q_SLOTS: Qt3DInput::Input::ButtonAxisInput backendAxisInput; Qt3DInput::QButtonAxisInput axisInput; axisInput.setEnabled(false); - axisInput.setButtons(QVector<int>() << Qt::Key_Space); + axisInput.setButtons(QList<int> { Qt::Key_Space }); axisInput.setScale(-1.0f); axisInput.setAcceleration(0.15f); axisInput.setDeceleration(0.3f); diff --git a/tests/auto/input/inputchord/tst_inputchord.cpp b/tests/auto/input/inputchord/tst_inputchord.cpp index e34fc4abe..97b448d9e 100644 --- a/tests/auto/input/inputchord/tst_inputchord.cpp +++ b/tests/auto/input/inputchord/tst_inputchord.cpp @@ -144,13 +144,13 @@ private Q_SLOTS: handler.addInputDeviceIntegration(&deviceIntegration); auto firstInput = new Qt3DInput::QActionInput; - firstInput->setButtons(QVector<int>() << Qt::Key_Q << Qt::Key_W); + firstInput->setButtons(QList<int> { Qt::Key_Q, Qt::Key_W }); firstInput->setSourceDevice(device); auto backendFirstInput = handler.actionInputManager()->getOrCreateResource(firstInput->id()); simulateInitializationSync(firstInput, backendFirstInput); auto secondInput = new Qt3DInput::QActionInput; - secondInput->setButtons(QVector<int>() << Qt::Key_A << Qt::Key_S); + secondInput->setButtons(QList<int> { Qt::Key_A, Qt::Key_S }); secondInput->setSourceDevice(device); auto backendSecondInput = handler.actionInputManager()->getOrCreateResource(secondInput->id()); simulateInitializationSync(secondInput, backendSecondInput); @@ -232,13 +232,13 @@ private Q_SLOTS: handler.addInputDeviceIntegration(&deviceIntegration); auto firstInput = new Qt3DInput::QActionInput; - firstInput->setButtons(QVector<int>() << Qt::Key_Q); + firstInput->setButtons(QList<int> { Qt::Key_Q }); firstInput->setSourceDevice(device); auto backendFirstInput = handler.actionInputManager()->getOrCreateResource(firstInput->id()); simulateInitializationSync(firstInput, backendFirstInput); auto secondInput = new Qt3DInput::QActionInput; - secondInput->setButtons(QVector<int>() << Qt::Key_W); + secondInput->setButtons(QList<int> { Qt::Key_W }); secondInput->setSourceDevice(device); auto backendSecondInput = handler.actionInputManager()->getOrCreateResource(secondInput->id()); simulateInitializationSync(secondInput, backendSecondInput); @@ -280,13 +280,13 @@ private Q_SLOTS: handler.addInputDeviceIntegration(&deviceIntegration); auto firstInput = new Qt3DInput::QActionInput; - firstInput->setButtons(QVector<int>() << Qt::Key_Q); + firstInput->setButtons(QList<int> { Qt::Key_Q }); firstInput->setSourceDevice(device); auto backendFirstInput = handler.actionInputManager()->getOrCreateResource(firstInput->id()); simulateInitializationSync(firstInput, backendFirstInput); auto secondInput = new Qt3DInput::QActionInput; - secondInput->setButtons(QVector<int>() << Qt::Key_W); + secondInput->setButtons(QList<int> { Qt::Key_W }); secondInput->setSourceDevice(device); auto backendSecondInput = handler.actionInputManager()->getOrCreateResource(secondInput->id()); simulateInitializationSync(secondInput, backendSecondInput); diff --git a/tests/auto/input/inputsequence/tst_inputsequence.cpp b/tests/auto/input/inputsequence/tst_inputsequence.cpp index 6059d7e9c..8a7939470 100644 --- a/tests/auto/input/inputsequence/tst_inputsequence.cpp +++ b/tests/auto/input/inputsequence/tst_inputsequence.cpp @@ -156,19 +156,19 @@ private Q_SLOTS: handler.addInputDeviceIntegration(&deviceIntegration); auto firstInput = new Qt3DInput::QActionInput; - firstInput->setButtons(QVector<int>() << Qt::Key_Q << Qt::Key_A); + firstInput->setButtons(QList<int> { Qt::Key_Q, Qt::Key_A }); firstInput->setSourceDevice(device); auto backendFirstInput = handler.actionInputManager()->getOrCreateResource(firstInput->id()); simulateInitializationSync(firstInput, backendFirstInput); auto secondInput = new Qt3DInput::QActionInput; - secondInput->setButtons(QVector<int>() << Qt::Key_S << Qt::Key_W); + secondInput->setButtons(QList<int> { Qt::Key_S, Qt::Key_W }); secondInput->setSourceDevice(device); auto backendSecondInput = handler.actionInputManager()->getOrCreateResource(secondInput->id()); simulateInitializationSync(secondInput, backendSecondInput); auto thirdInput = new Qt3DInput::QActionInput; - thirdInput->setButtons(QVector<int>() << Qt::Key_D << Qt::Key_E); + thirdInput->setButtons(QList<int> { Qt::Key_D, Qt::Key_E }); thirdInput->setSourceDevice(device); auto backendThirdInput = handler.actionInputManager()->getOrCreateResource(thirdInput->id()); simulateInitializationSync(thirdInput, backendThirdInput); @@ -282,19 +282,19 @@ private Q_SLOTS: handler.addInputDeviceIntegration(&deviceIntegration); auto firstInput = new Qt3DInput::QActionInput; - firstInput->setButtons(QVector<int>() << Qt::Key_Q << Qt::Key_A); + firstInput->setButtons(QList<int> { Qt::Key_Q, Qt::Key_A }); firstInput->setSourceDevice(device); auto backendFirstInput = handler.actionInputManager()->getOrCreateResource(firstInput->id()); simulateInitializationSync(firstInput, backendFirstInput); auto secondInput = new Qt3DInput::QActionInput; - secondInput->setButtons(QVector<int>() << Qt::Key_S << Qt::Key_W); + secondInput->setButtons(QList<int> { Qt::Key_S, Qt::Key_W }); secondInput->setSourceDevice(device); auto backendSecondInput = handler.actionInputManager()->getOrCreateResource(secondInput->id()); simulateInitializationSync(secondInput, backendSecondInput); auto thirdInput = new Qt3DInput::QActionInput; - thirdInput->setButtons(QVector<int>() << Qt::Key_D << Qt::Key_E); + thirdInput->setButtons(QList<int> { Qt::Key_D, Qt::Key_E }); thirdInput->setSourceDevice(device); auto backendThirdInput = handler.actionInputManager()->getOrCreateResource(thirdInput->id()); simulateInitializationSync(thirdInput, backendThirdInput); @@ -340,19 +340,19 @@ private Q_SLOTS: handler.addInputDeviceIntegration(&deviceIntegration); auto firstInput = new Qt3DInput::QActionInput; - firstInput->setButtons(QVector<int>() << Qt::Key_Q << Qt::Key_A); + firstInput->setButtons(QList<int> { Qt::Key_Q, Qt::Key_A }); firstInput->setSourceDevice(device); auto backendFirstInput = handler.actionInputManager()->getOrCreateResource(firstInput->id()); simulateInitializationSync(firstInput, backendFirstInput); auto secondInput = new Qt3DInput::QActionInput; - secondInput->setButtons(QVector<int>() << Qt::Key_S << Qt::Key_W); + secondInput->setButtons(QList<int> { Qt::Key_S, Qt::Key_W }); secondInput->setSourceDevice(device); auto backendSecondInput = handler.actionInputManager()->getOrCreateResource(secondInput->id()); simulateInitializationSync(secondInput, backendSecondInput); auto thirdInput = new Qt3DInput::QActionInput; - thirdInput->setButtons(QVector<int>() << Qt::Key_D << Qt::Key_E); + thirdInput->setButtons(QList<int> { Qt::Key_D, Qt::Key_E }); thirdInput->setSourceDevice(device); auto backendThirdInput = handler.actionInputManager()->getOrCreateResource(thirdInput->id()); simulateInitializationSync(thirdInput, backendThirdInput); @@ -398,13 +398,13 @@ private Q_SLOTS: handler.addInputDeviceIntegration(&deviceIntegration); auto firstInput = new Qt3DInput::QActionInput; - firstInput->setButtons(QVector<int>() << Qt::Key_Q); + firstInput->setButtons(QList<int> { Qt::Key_Q }); firstInput->setSourceDevice(device); auto backendFirstInput = handler.actionInputManager()->getOrCreateResource(firstInput->id()); simulateInitializationSync(firstInput, backendFirstInput); auto secondInput = new Qt3DInput::QActionInput; - secondInput->setButtons(QVector<int>() << Qt::Key_S); + secondInput->setButtons(QList<int> { Qt::Key_S }); secondInput->setSourceDevice(device); auto backendSecondInput = handler.actionInputManager()->getOrCreateResource(secondInput->id()); simulateInitializationSync(secondInput, backendSecondInput); diff --git a/tests/auto/input/loadproxydevicejob/tst_loadproxydevicejob.cpp b/tests/auto/input/loadproxydevicejob/tst_loadproxydevicejob.cpp index f1ae313e2..41f5529a2 100644 --- a/tests/auto/input/loadproxydevicejob/tst_loadproxydevicejob.cpp +++ b/tests/auto/input/loadproxydevicejob/tst_loadproxydevicejob.cpp @@ -63,9 +63,9 @@ public: return nullptr; } - QVector<Qt3DCore::QNodeId> physicalDevices() const override + QList<Qt3DCore::QNodeId> physicalDevices() const override { - return QVector<Qt3DCore::QNodeId>(); + return {}; } QStringList deviceNames() const override @@ -125,7 +125,7 @@ private Q_SLOTS: QCOMPARE(backendProxy->deviceName(), QStringLiteral("TestProxy")); QVERIFY(backendProxy->physicalDeviceId().isNull()); - const QVector<Qt3DCore::QNodeId> pendingProxies = manager->takePendingProxiesToLoad(); + const QList<Qt3DCore::QNodeId> pendingProxies = manager->takePendingProxiesToLoad(); QCOMPARE(pendingProxies.size(), 1); QCOMPARE(pendingProxies.first(), backendProxy->peerId()); @@ -157,7 +157,7 @@ private Q_SLOTS: QCOMPARE(manager->lookupResource(proxy.id()), backendProxy); QCOMPARE(backendProxy->deviceName(), QStringLiteral("NonExisting")); - const QVector<Qt3DCore::QNodeId> pendingProxies = manager->takePendingProxiesToLoad(); + const QList<Qt3DCore::QNodeId> pendingProxies = manager->takePendingProxiesToLoad(); QCOMPARE(pendingProxies.size(), 1); QCOMPARE(pendingProxies.first(), backendProxy->peerId()); diff --git a/tests/auto/input/physicaldeviceproxy/tst_physicaldeviceproxy.cpp b/tests/auto/input/physicaldeviceproxy/tst_physicaldeviceproxy.cpp index a6059f1f0..ae58e0a2b 100644 --- a/tests/auto/input/physicaldeviceproxy/tst_physicaldeviceproxy.cpp +++ b/tests/auto/input/physicaldeviceproxy/tst_physicaldeviceproxy.cpp @@ -102,7 +102,7 @@ private Q_SLOTS: // THEN QCOMPARE(backendPhysicalDeviceProxy.deviceName(), QStringLiteral("TestProxy")); - const QVector<Qt3DCore::QNodeId> pendingWrappers = manager.takePendingProxiesToLoad(); + const QList<Qt3DCore::QNodeId> pendingWrappers = manager.takePendingProxiesToLoad(); QCOMPARE(pendingWrappers.size(), 1); QCOMPARE(pendingWrappers.first(), deviceProxy.id()); } diff --git a/tests/auto/input/qabstractphysicaldevicebackendnode/tst_qabstractphysicaldevicebackendnode.cpp b/tests/auto/input/qabstractphysicaldevicebackendnode/tst_qabstractphysicaldevicebackendnode.cpp index 0add25778..a0e910c77 100644 --- a/tests/auto/input/qabstractphysicaldevicebackendnode/tst_qabstractphysicaldevicebackendnode.cpp +++ b/tests/auto/input/qabstractphysicaldevicebackendnode/tst_qabstractphysicaldevicebackendnode.cpp @@ -180,8 +180,8 @@ private Q_SLOTS: Qt3DInput::QAxisSetting settings1; Qt3DInput::QAxisSetting settings2; - settings1.setAxes(QVector<int>() << 883); - settings2.setAxes(QVector<int>() << 454); + settings1.setAxes(QList<int> { 883 }); + settings2.setAxes(QList<int> { 454 }); Qt3DInput::QAbstractPhysicalDeviceBackendNodePrivate *priv = static_cast<Qt3DInput::QAbstractPhysicalDeviceBackendNodePrivate *>( Qt3DCore::QBackendNodePrivate::get(&backendQAbstractPhysicalDeviceBackendNode)); diff --git a/tests/auto/input/qactioninput/tst_qactioninput.cpp b/tests/auto/input/qactioninput/tst_qactioninput.cpp index 985efb534..86bcd82ec 100644 --- a/tests/auto/input/qactioninput/tst_qactioninput.cpp +++ b/tests/auto/input/qactioninput/tst_qactioninput.cpp @@ -57,7 +57,7 @@ private Q_SLOTS: arbiter.setArbiterOnNode(actionInput.data()); // WHEN - QVector<int> buttons = QVector<int>() << 555; + const QList<int> buttons = { 555 }; actionInput->setButtons(buttons); // THEN diff --git a/tests/auto/input/qbuttonaxisinput/tst_qbuttonaxisinput.cpp b/tests/auto/input/qbuttonaxisinput/tst_qbuttonaxisinput.cpp index 6a53c1b89..19a754ae3 100644 --- a/tests/auto/input/qbuttonaxisinput/tst_qbuttonaxisinput.cpp +++ b/tests/auto/input/qbuttonaxisinput/tst_qbuttonaxisinput.cpp @@ -67,7 +67,7 @@ private Q_SLOTS: arbiter.setArbiterOnNode(axisInput.data()); // WHEN - QVector<int> buttons = QVector<int>() << 555; + const QList<int> buttons = { 555 }; axisInput->setButtons(buttons); // THEN diff --git a/tests/auto/input/utils/tst_utils.cpp b/tests/auto/input/utils/tst_utils.cpp index e18e820c8..87c5cd6a0 100644 --- a/tests/auto/input/utils/tst_utils.cpp +++ b/tests/auto/input/utils/tst_utils.cpp @@ -57,7 +57,7 @@ public: std::vector<Qt3DCore::QAspectJobPtr> jobsToExecute(qint64) override { return std::vector<Qt3DCore::QAspectJobPtr>(); } Qt3DInput::QAbstractPhysicalDevice *createPhysicalDevice(const QString &) override { return nullptr; } - QVector<Qt3DCore::QNodeId> physicalDevices() const override { return QVector<Qt3DCore::QNodeId>(); } + QList<Qt3DCore::QNodeId> physicalDevices() const override { return {}; } QStringList deviceNames() const override { return QStringList(); } Qt3DInput::QAbstractPhysicalDeviceBackendNode *physicalDevice(Qt3DCore::QNodeId deviceId) const override diff --git a/tests/auto/quick3d/quick3dbuffer/tst_quick3dbuffer.cpp b/tests/auto/quick3d/quick3dbuffer/tst_quick3dbuffer.cpp index 21f62ac00..fccf5f13f 100644 --- a/tests/auto/quick3d/quick3dbuffer/tst_quick3dbuffer.cpp +++ b/tests/auto/quick3d/quick3dbuffer/tst_quick3dbuffer.cpp @@ -67,9 +67,8 @@ private Q_SLOTS: { // GIVEN Qt3DCore::Quick::Quick3DBuffer buf; - QVector<QVector3D> dataArray = QVector<QVector3D>() - << QVector3D(327.0f, 350.0f, 355.0f) - << QVector3D(383.0f, 427.0f, 454.0f); + const QList<QVector3D> dataArray = { QVector3D(327.0f, 350.0f, 355.0f), + QVector3D(383.0f, 427.0f, 454.0f) }; const int bufferByteSize = dataArray.size() * sizeof(QVector3D); const QLatin1String filePath("binary_data.bin"); diff --git a/tests/auto/quick3d/quick3dnodeinstantiator/tst_quick3dnodeinstantiator.cpp b/tests/auto/quick3d/quick3dnodeinstantiator/tst_quick3dnodeinstantiator.cpp index d4d0d56e2..76568d67d 100644 --- a/tests/auto/quick3d/quick3dnodeinstantiator/tst_quick3dnodeinstantiator.cpp +++ b/tests/auto/quick3d/quick3dnodeinstantiator/tst_quick3dnodeinstantiator.cpp @@ -243,8 +243,7 @@ void tst_quick3dnodeinstantiator::createAndRemove() qobject_cast<Quick3DNodeInstantiator*>(rootObject->findChild<QObject*>("instantiator1")); QVERIFY(instantiator != 0); model->drop(1); - QVector<QString> names; - names << "Beta" << "Gamma" << "Delta"; + const QList<QString> names = { "Beta", "Gamma", "Delta" }; for (int i = 0; i < 3; i++) { QObject *object = instantiator->objectAt(i); QVERIFY(object); diff --git a/tests/auto/render/boundingsphere/tst_boundingsphere.cpp b/tests/auto/render/boundingsphere/tst_boundingsphere.cpp index 62a7272a5..ea69b5017 100644 --- a/tests/auto/render/boundingsphere/tst_boundingsphere.cpp +++ b/tests/auto/render/boundingsphere/tst_boundingsphere.cpp @@ -63,11 +63,11 @@ QT_BEGIN_NAMESPACE namespace Qt3DRender { -QVector<Qt3DCore::QNode *> getNodesForCreation(Qt3DCore::QNode *root) +QList<Qt3DCore::QNode *> getNodesForCreation(Qt3DCore::QNode *root) { using namespace Qt3DCore; - QVector<QNode *> nodes; + QList<QNode *> nodes; Qt3DCore::QNodeVisitor visitor; visitor.traverse(root, [&nodes](QNode *node) { nodes.append(node); @@ -87,9 +87,9 @@ QVector<Qt3DCore::QNode *> getNodesForCreation(Qt3DCore::QNode *root) return nodes; } -QVector<Qt3DCore::NodeTreeChange> nodeTreeChangesForNodes(const QVector<Qt3DCore::QNode *> nodes) +QList<Qt3DCore::NodeTreeChange> nodeTreeChangesForNodes(const QList<Qt3DCore::QNode *> nodes) { - QVector<Qt3DCore::NodeTreeChange> nodeTreeChanges; + QList<Qt3DCore::NodeTreeChange> nodeTreeChanges; nodeTreeChanges.reserve(nodes.size()); for (Qt3DCore::QNode *n : nodes) { @@ -114,8 +114,8 @@ public: QRenderAspect::onRegistered(); m_root = qobject_cast<Qt3DCore::QEntity *>(root); - const QVector<Qt3DCore::QNode *> nodes = getNodesForCreation(root); - const QVector<Qt3DCore::NodeTreeChange> nodeTreeChanges = nodeTreeChangesForNodes(nodes); + const QList<Qt3DCore::QNode *> nodes = getNodesForCreation(root); + const QList<Qt3DCore::NodeTreeChange> nodeTreeChanges = nodeTreeChangesForNodes(nodes); d_func()->setRootAndCreateNodes(m_root, nodeTreeChanges); Render::Entity *rootEntity = nodeManagers()->lookupResource<Render::Entity, Render::EntityManager>(rootEntityId()); @@ -150,8 +150,8 @@ public: }); } Qt3DCore::QNode *lookupNode(Qt3DCore::QNodeId id) const override { return m_frontEndNodes.value(id, nullptr); } - QVector<Qt3DCore::QNode *> lookupNodes(const QVector<Qt3DCore::QNodeId> &ids) const override { - QVector<Qt3DCore::QNode *> res; + QList<Qt3DCore::QNode *> lookupNodes(const QList<Qt3DCore::QNodeId> &ids) const override { + QList<Qt3DCore::QNode *> res; for (const auto &id: ids) { auto node = m_frontEndNodes.value(id, nullptr); if (node) @@ -293,7 +293,7 @@ private Q_SLOTS: } void ritterSphereCubePoints() { - QVector<Vector3D> cubePts={ + QList<Vector3D> cubePts={ Vector3D(-0.5, -0.5, 0.5), Vector3D( 0.5, -0.5, -0.5), Vector3D(-0.5, 0.5, -0.5), @@ -312,7 +312,7 @@ private Q_SLOTS: } void ritterSphereRandomPoints() { - QVector<Vector3D> randomPts={ + QList<Vector3D> randomPts={ Vector3D(-81, 55, 46), Vector3D(-91, -73, -42), Vector3D(-50, -76, -77), @@ -334,7 +334,7 @@ private Q_SLOTS: } void ritterSphereOnePoint() { - QVector<Vector3D> singlePt={ + QList<Vector3D> singlePt={ Vector3D(-0.5, -0.5, -0.5), }; auto ritterSphere = Qt3DRender::Render::Sphere::fromPoints(singlePt); @@ -464,7 +464,7 @@ private Q_SLOTS: for (int i = 0; i < 2; ++i) g->addAttribute(new Qt3DCore::QAttribute); - const QVector<Qt3DCore::QAttribute *> attrs = g->attributes(); + const QList<Qt3DCore::QAttribute *> attrs = g->attributes(); Qt3DCore::QAttribute *attr = attrs[0]; attr->setBuffer(vbuffer); attr->setName(Qt3DCore::QAttribute::defaultPositionAttributeName()); @@ -576,7 +576,7 @@ private Q_SLOTS: Qt3DCore::QGeometry *g = new Qt3DCore::QGeometry; g->addAttribute(new Qt3DCore::QAttribute); - const QVector<Qt3DCore::QAttribute *> attrs = g->attributes(); + const QList<Qt3DCore::QAttribute *> attrs = g->attributes(); Qt3DCore::QAttribute *attr = attrs[0]; attr->setBuffer(vbuffer); attr->setName(Qt3DCore::QAttribute::defaultPositionAttributeName()); diff --git a/tests/auto/render/entity/tst_entity.cpp b/tests/auto/render/entity/tst_entity.cpp index 2408cac5b..f81bc5c92 100644 --- a/tests/auto/render/entity/tst_entity.cpp +++ b/tests/auto/render/entity/tst_entity.cpp @@ -50,7 +50,7 @@ #include "testrenderer.h" typedef Qt3DCore::QNodeId (*UuidMethod)(Qt3DRender::Render::Entity *); -typedef QVector<Qt3DCore::QNodeId> (*UuidListMethod)(Qt3DRender::Render::Entity *); +typedef QList<Qt3DCore::QNodeId> (*UuidListMethod)(Qt3DRender::Render::Entity *); using namespace Qt3DCore; using namespace Qt3DRender; @@ -64,9 +64,9 @@ QNodeId objectPickerUuid(Entity *entity) { return entity->componentUuid<ObjectPi QNodeId computeJobUuid(Entity *entity) { return entity->componentUuid<ComputeCommand>(); } QNodeId armatureUuid(Entity *entity) { return entity->componentUuid<Armature>(); } -QVector<QNodeId> layersUuid(Entity *entity) { return entity->componentsUuid<Layer>(); } -QVector<QNodeId> shadersUuid(Entity *entity) { return entity->componentsUuid<ShaderData>(); } -QVector<QNodeId> environmentLightsUuid(Entity *entity) { return entity->componentsUuid<EnvironmentLight>(); } +QList<QNodeId> layersUuid(Entity *entity) { return entity->componentsUuid<Layer>(); } +QList<QNodeId> shadersUuid(Entity *entity) { return entity->componentsUuid<ShaderData>(); } +QList<QNodeId> environmentLightsUuid(Entity *entity) { return entity->componentsUuid<EnvironmentLight>(); } class CompleteVisitor : public EntityVisitor { diff --git a/tests/auto/render/framegraphvisitor/tst_framegraphvisitor.cpp b/tests/auto/render/framegraphvisitor/tst_framegraphvisitor.cpp index e9d9063a7..417260a61 100644 --- a/tests/auto/render/framegraphvisitor/tst_framegraphvisitor.cpp +++ b/tests/auto/render/framegraphvisitor/tst_framegraphvisitor.cpp @@ -62,9 +62,9 @@ namespace { } // anonymous using FGIdType = QPair<Qt3DCore::QNodeId, Qt3DRender::Render::FrameGraphNode::FrameGraphNodeType>; -using BranchIdsAndTypes = QVector<FGIdType>; +using BranchIdsAndTypes = QList<FGIdType>; -Q_DECLARE_METATYPE(QVector<BranchIdsAndTypes>) +Q_DECLARE_METATYPE(QList<BranchIdsAndTypes>) class tst_FrameGraphVisitor : public QObject { @@ -75,7 +75,7 @@ private Q_SLOTS: { QTest::addColumn<Qt3DCore::QEntity *>("rootEntity"); QTest::addColumn<Qt3DRender::QFrameGraphNode *>("fgRoot"); - QTest::addColumn<QVector<BranchIdsAndTypes>>("fgNodeIdsPerBranch"); + QTest::addColumn<QList<BranchIdsAndTypes>>("fgNodeIdsPerBranch"); { Qt3DCore::QEntity *entity = new Qt3DCore::QEntity(); @@ -83,7 +83,7 @@ private Q_SLOTS: QTest::newRow("singleNode") << entity << static_cast<Qt3DRender::QFrameGraphNode *>(techniqueFilter) - << (QVector<BranchIdsAndTypes>() + << (QList<BranchIdsAndTypes>() << (BranchIdsAndTypes() << FGIdType(techniqueFilter->id(), Qt3DRender::Render::FrameGraphNode::TechniqueFilter)) ); } @@ -96,7 +96,7 @@ private Q_SLOTS: QTest::newRow("singleBranch") << entity << static_cast<Qt3DRender::QFrameGraphNode *>(techniqueFilter) - << (QVector<BranchIdsAndTypes>() + << (QList<BranchIdsAndTypes>() << (BranchIdsAndTypes() << FGIdType(noDraw->id(), Qt3DRender::Render::FrameGraphNode::NoDraw) << FGIdType(frustumCulling->id(), Qt3DRender::Render::FrameGraphNode::FrustumCulling) @@ -113,7 +113,7 @@ private Q_SLOTS: QTest::newRow("dualBranch") << entity << static_cast<Qt3DRender::QFrameGraphNode *>(techniqueFilter) - << (QVector<BranchIdsAndTypes>() + << (QList<BranchIdsAndTypes>() << (BranchIdsAndTypes() << FGIdType(noDraw->id(), Qt3DRender::Render::FrameGraphNode::NoDraw) << FGIdType(frustumCulling->id(), Qt3DRender::Render::FrameGraphNode::FrustumCulling) @@ -134,7 +134,7 @@ private Q_SLOTS: // GIVEN QFETCH(Qt3DCore::QEntity *, rootEntity); QFETCH(Qt3DRender::QFrameGraphNode *, fgRoot); - QFETCH(QVector<BranchIdsAndTypes>, fgNodeIdsPerBranch); + QFETCH(QList<BranchIdsAndTypes>, fgNodeIdsPerBranch); QScopedPointer<Qt3DRender::TestAspect> aspect(new Qt3DRender::TestAspect(rootEntity)); // THEN diff --git a/tests/auto/render/gltexture/tst_gltexture.cpp b/tests/auto/render/gltexture/tst_gltexture.cpp index 7d8c679f3..781e4a38d 100644 --- a/tests/auto/render/gltexture/tst_gltexture.cpp +++ b/tests/auto/render/gltexture/tst_gltexture.cpp @@ -638,7 +638,7 @@ private Q_SLOTS: // WHEN texture.createOrUpdateGLTexture(); texture.setGenerator(QSharedPointer<FakeTexture2DGenerator>::create()); - QVector<GLTexture::Image> images; + QList<GLTexture::Image> images; QImageTextureDataFunctorPtr gen = QImageTextureDataFunctorPtr::create(QUrl("qrc:/image.jpg"), true); images.push_back({gen, 1, 0, QAbstractTexture::CubeMapPositiveX}); texture.setImages(images); @@ -684,7 +684,7 @@ private Q_SLOTS: // WHEN texture.setGenerator(QSharedPointer<FakeTexture2DGenerator>::create()); - QVector<GLTexture::Image> images; + QList<GLTexture::Image> images; // Test image has a size of 512/512 QImageTextureDataFunctorPtr gen = QImageTextureDataFunctorPtr::create(QUrl("qrc:/image.jpg"), true); images.push_back({gen, 1, 0, QAbstractTexture::CubeMapPositiveX}); @@ -879,7 +879,7 @@ private Q_SLOTS: props.width = 1; props.height = 1; texture.setProperties(props); - QVector<GLTexture::Image> images; + QList<GLTexture::Image> images; // test a image texture data generator whose url is invalid QImageTextureDataFunctorPtr gen = QImageTextureDataFunctorPtr::create(QUrl(), true); images.push_back({gen, 0, 0, QAbstractTexture::CubeMapPositiveX}); diff --git a/tests/auto/render/gltfplugins/tst_gltfplugins.cpp b/tests/auto/render/gltfplugins/tst_gltfplugins.cpp index fbf24b22e..813157251 100644 --- a/tests/auto/render/gltfplugins/tst_gltfplugins.cpp +++ b/tests/auto/render/gltfplugins/tst_gltfplugins.cpp @@ -129,12 +129,12 @@ private: Qt3DCore::QAttribute::AttributeType type, Qt3DCore::QGeometry *geometry); void compareAttributes(Qt3DCore::QAttribute *a1, Qt3DCore::QAttribute *a2); - void compareParameters(const QVector<Qt3DRender::QParameter *> ¶ms1, - const QVector<Qt3DRender::QParameter *> ¶ms2); - void compareRenderPasses(const QVector<Qt3DRender::QRenderPass *> &passes1, - const QVector<Qt3DRender::QRenderPass *> &passes2); - void compareFilterKeys(const QVector<Qt3DRender::QFilterKey *> &keys1, - const QVector<Qt3DRender::QFilterKey *> &keys2); + void compareParameters(const QList<Qt3DRender::QParameter *> ¶ms1, + const QList<Qt3DRender::QParameter *> ¶ms2); + void compareRenderPasses(const QList<Qt3DRender::QRenderPass *> &passes1, + const QList<Qt3DRender::QRenderPass *> &passes2); + void compareFilterKeys(const QList<Qt3DRender::QFilterKey *> &keys1, + const QList<Qt3DRender::QFilterKey *> &keys2); QUrl getTextureUrl(Qt3DRender::QAbstractTexture *tex); Qt3DRender::QGeometryRenderer *createCustomCube(); Qt3DRender::QEffect *createOnTopEffect(); @@ -883,8 +883,8 @@ void tst_gltfPlugins::compareAttributes(Qt3DCore::QAttribute *a1, Qt3DCore::QAtt } } -void tst_gltfPlugins::compareParameters(const QVector<Qt3DRender::QParameter *> ¶ms1, - const QVector<Qt3DRender::QParameter *> ¶ms2) +void tst_gltfPlugins::compareParameters(const QList<Qt3DRender::QParameter *> ¶ms1, + const QList<Qt3DRender::QParameter *> ¶ms2) { QCOMPARE(params1.size(), params2.size()); for (auto p1 : params1) { @@ -913,8 +913,8 @@ void tst_gltfPlugins::compareParameters(const QVector<Qt3DRender::QParameter *> } } -void tst_gltfPlugins::compareRenderPasses(const QVector<Qt3DRender::QRenderPass *> &passes1, - const QVector<Qt3DRender::QRenderPass *> &passes2) +void tst_gltfPlugins::compareRenderPasses(const QList<Qt3DRender::QRenderPass *> &passes1, + const QList<Qt3DRender::QRenderPass *> &passes2) { QCOMPARE(passes1.size(), passes2.size()); for (auto pass1 : passes1) { @@ -925,8 +925,8 @@ void tst_gltfPlugins::compareRenderPasses(const QVector<Qt3DRender::QRenderPass compareFilterKeys(pass1->filterKeys(), pass2->filterKeys()); compareParameters(pass1->parameters(), pass2->parameters()); - QVector<Qt3DRender::QRenderState *> states1 = pass1->renderStates(); - QVector<Qt3DRender::QRenderState *> states2 = pass2->renderStates(); + const QList<Qt3DRender::QRenderState *> states1 = pass1->renderStates(); + const QList<Qt3DRender::QRenderState *> states2 = pass2->renderStates(); QCOMPARE(states1.size(), states2.size()); for (auto state1 : states1) { bool stateMatch = false; @@ -949,8 +949,8 @@ void tst_gltfPlugins::compareRenderPasses(const QVector<Qt3DRender::QRenderPass } } -void tst_gltfPlugins::compareFilterKeys(const QVector<Qt3DRender::QFilterKey *> &keys1, - const QVector<Qt3DRender::QFilterKey *> &keys2) +void tst_gltfPlugins::compareFilterKeys(const QList<Qt3DRender::QFilterKey *> &keys1, + const QList<Qt3DRender::QFilterKey *> &keys2) { QCOMPARE(keys1.size(), keys2.size()); for (auto k1 : keys1) { diff --git a/tests/auto/render/joint/tst_joint.cpp b/tests/auto/render/joint/tst_joint.cpp index c0b4a7a3b..7b227f0a2 100644 --- a/tests/auto/render/joint/tst_joint.cpp +++ b/tests/auto/render/joint/tst_joint.cpp @@ -66,7 +66,7 @@ private Q_SLOTS: inverseBind.rotate(-45.0f, 1.0f, 0.0, 0.0f); joint.setInverseBindMatrix(inverseBind); - QVector<QJoint *> childJoints; + QList<QJoint *> childJoints; for (int i = 0; i < 10; ++i) { const auto childJoint = new QJoint(); joint.addChildJoint(childJoint); @@ -118,7 +118,7 @@ private Q_SLOTS: inverseBind.rotate(-45.0f, 1.0f, 0.0, 0.0f); joint.setInverseBindMatrix(inverseBind); - QVector<QJoint *> childJoints; + QList<QJoint *> childJoints; for (int i = 0; i < 10; ++i) { const auto childJoint = new QJoint(); joint.addChildJoint(childJoint); @@ -193,7 +193,7 @@ private Q_SLOTS: QCOMPARE(backendJoint.inverseBindMatrix(), newInverseBind); // WHEN - QVector<QJoint *> childJoints; + QList<QJoint *> childJoints; for (int i = 0; i < 10; ++i) { const auto childJoint = new QJoint(); childJoints.push_back(childJoint); @@ -272,7 +272,7 @@ private Q_SLOTS: QCOMPARE(backendJoint.inverseBindMatrix(), newInverseBind); // WHEN - QVector<QJoint *> childJoints; + QList<QJoint *> childJoints; for (int i = 0; i < 10; ++i) { const auto childJoint = new QJoint(); joint.addChildJoint(childJoint); diff --git a/tests/auto/render/levelofdetail/tst_levelofdetail.cpp b/tests/auto/render/levelofdetail/tst_levelofdetail.cpp index c0c06975a..2189ef1a0 100644 --- a/tests/auto/render/levelofdetail/tst_levelofdetail.cpp +++ b/tests/auto/render/levelofdetail/tst_levelofdetail.cpp @@ -113,7 +113,7 @@ private Q_SLOTS: renderer.clearDirtyBits(Qt3DRender::Render::AbstractRenderer::AllDirty); } { - const QVector<qreal> thresholds = {20.f, 30.f, 40.f}; + const QList<qreal> thresholds = { 20.f, 30.f, 40.f }; // WHEN lod.setThresholds(thresholds); diff --git a/tests/auto/render/opengl/filtercompatibletechniquejob/tst_filtercompatibletechniquejob.cpp b/tests/auto/render/opengl/filtercompatibletechniquejob/tst_filtercompatibletechniquejob.cpp index 4176da227..177de302a 100644 --- a/tests/auto/render/opengl/filtercompatibletechniquejob/tst_filtercompatibletechniquejob.cpp +++ b/tests/auto/render/opengl/filtercompatibletechniquejob/tst_filtercompatibletechniquejob.cpp @@ -76,7 +76,7 @@ public: Qt3DCore::QAbstractAspectPrivate::get(this)->m_jobManager = m_jobManager.data(); QRenderAspect::onRegistered(); - QVector<Qt3DCore::QNode *> nodes; + QList<Qt3DCore::QNode *> nodes; Qt3DCore::QNodeVisitor v; v.traverse(root, [&nodes](Qt3DCore::QNode *node) { Qt3DCore::QNodePrivate *d = Qt3DCore::QNodePrivate::get(node); diff --git a/tests/auto/render/opengl/graphicshelpergl3_2/tst_graphicshelpergl3_2.cpp b/tests/auto/render/opengl/graphicshelpergl3_2/tst_graphicshelpergl3_2.cpp index 8b810ddb6..21335e541 100644 --- a/tests/auto/render/opengl/graphicshelpergl3_2/tst_graphicshelpergl3_2.cpp +++ b/tests/auto/render/opengl/graphicshelpergl3_2/tst_graphicshelpergl3_2.cpp @@ -549,7 +549,7 @@ private Q_SLOTS: QVERIFY(error == 0); // THEN - QVector<QVector4D> colors(512 * 512); + QList<QVector4D> colors(512 * 512); textures[3]->bind(); m_func->glGetTexImage(GL_TEXTURE_2D, 0, GL_RGBA, GL_FLOAT, colors.data()); textures[3]->release(); diff --git a/tests/auto/render/opengl/graphicshelpergl3_3/tst_graphicshelpergl3_3.cpp b/tests/auto/render/opengl/graphicshelpergl3_3/tst_graphicshelpergl3_3.cpp index a14e20df2..63a256dc0 100644 --- a/tests/auto/render/opengl/graphicshelpergl3_3/tst_graphicshelpergl3_3.cpp +++ b/tests/auto/render/opengl/graphicshelpergl3_3/tst_graphicshelpergl3_3.cpp @@ -647,7 +647,7 @@ private Q_SLOTS: QVERIFY(error == 0); // THEN - QVector<QVector4D> colors(512 * 512); + QList<QVector4D> colors(512 * 512); textures[3]->bind(); m_func->glGetTexImage(GL_TEXTURE_2D, 0, GL_RGBA, GL_FLOAT, colors.data()); textures[3]->release(); diff --git a/tests/auto/render/opengl/graphicshelpergl4/tst_graphicshelpergl4.cpp b/tests/auto/render/opengl/graphicshelpergl4/tst_graphicshelpergl4.cpp index 9307b7312..595c50f08 100644 --- a/tests/auto/render/opengl/graphicshelpergl4/tst_graphicshelpergl4.cpp +++ b/tests/auto/render/opengl/graphicshelpergl4/tst_graphicshelpergl4.cpp @@ -817,7 +817,7 @@ private Q_SLOTS: QVERIFY(error == 0); // THEN - QVector<QVector4D> colors(512 * 512); + QList<QVector4D> colors(512 * 512); textures[3]->bind(); m_func->glGetTexImage(GL_TEXTURE_2D, 0, GL_RGBA, GL_FLOAT, colors.data()); textures[3]->release(); diff --git a/tests/auto/render/opengl/materialparametergathererjob/tst_materialparametergathererjob.cpp b/tests/auto/render/opengl/materialparametergathererjob/tst_materialparametergathererjob.cpp index c1aff3b7c..65e8d7ba8 100644 --- a/tests/auto/render/opengl/materialparametergathererjob/tst_materialparametergathererjob.cpp +++ b/tests/auto/render/opengl/materialparametergathererjob/tst_materialparametergathererjob.cpp @@ -68,7 +68,7 @@ public: Qt3DCore::QAbstractAspectPrivate::get(this)->m_jobManager = m_jobManager.data(); QRenderAspect::onRegistered(); - QVector<Qt3DCore::QNode *> nodes; + QList<Qt3DCore::QNode *> nodes; Qt3DCore::QNodeVisitor v; v.traverse(root, [&nodes](Qt3DCore::QNode *node) { Qt3DCore::QNodePrivate *d = Qt3DCore::QNodePrivate::get(node); diff --git a/tests/auto/render/opengl/qgraphicsutils/tst_qgraphicsutils.cpp b/tests/auto/render/opengl/qgraphicsutils/tst_qgraphicsutils.cpp index bd4772045..f14be4177 100644 --- a/tests/auto/render/opengl/qgraphicsutils/tst_qgraphicsutils.cpp +++ b/tests/auto/render/opengl/qgraphicsutils/tst_qgraphicsutils.cpp @@ -168,7 +168,7 @@ void tst_QGraphicsUtils::fillScalarWithOffsets() intUniform.m_matrixStride = 0; intUniform.m_offset = 48; - QVector<GLfloat> data(16); + QList<GLfloat> data(16); void *innerData = data.data(); Qt3DRender::Render::OpenGL::QGraphicsUtils::fillDataArray(innerData, diff --git a/tests/auto/render/opengl/renderqueue/tst_renderqueue.cpp b/tests/auto/render/opengl/renderqueue/tst_renderqueue.cpp index 926591c7c..8ea914318 100644 --- a/tests/auto/render/opengl/renderqueue/tst_renderqueue.cpp +++ b/tests/auto/render/opengl/renderqueue/tst_renderqueue.cpp @@ -101,7 +101,7 @@ void tst_RenderQueue::checkOrder() // GIVEN Qt3DRender::Render::RenderQueue<Qt3DRender::Render::OpenGL::RenderView> renderQueue; renderQueue.setTargetRenderViewCount(7); - QVector<Qt3DRender::Render::OpenGL::RenderView *> renderViews(7); + QList<Qt3DRender::Render::OpenGL::RenderView *> renderViews(7); // WHEN for (int i = 0; i < 7; ++i) { @@ -122,7 +122,7 @@ void tst_RenderQueue::checkTimeToSubmit() // GIVEN Qt3DRender::Render::RenderQueue<Qt3DRender::Render::OpenGL::RenderView> renderQueue; renderQueue.setTargetRenderViewCount(7); - QVector<Qt3DRender::Render::OpenGL::RenderView *> renderViews(7); + QList<Qt3DRender::Render::OpenGL::RenderView *> renderViews(7); // WHEN for (int i = 0; i < 7; i++) { @@ -222,7 +222,7 @@ void tst_RenderQueue::resetQueue() QVERIFY(renderQueue.currentRenderViewCount() == 0); // WHEN - QVector<Qt3DRender::Render::OpenGL::RenderView *> renderViews(5); + QList<Qt3DRender::Render::OpenGL::RenderView *> renderViews(5); for (int i = 0; i < 5; ++i) { renderQueue.queueRenderView(renderViews.at(i), i); } diff --git a/tests/auto/render/opengl/renderviewbuilder/tst_renderviewbuilder.cpp b/tests/auto/render/opengl/renderviewbuilder/tst_renderviewbuilder.cpp index 31ffef0c3..fa7c4f32a 100644 --- a/tests/auto/render/opengl/renderviewbuilder/tst_renderviewbuilder.cpp +++ b/tests/auto/render/opengl/renderviewbuilder/tst_renderviewbuilder.cpp @@ -69,7 +69,7 @@ public: Qt3DCore::QAbstractAspectPrivate::get(this)->m_jobManager = m_jobManager.data(); QRenderAspect::onRegistered(); - QVector<Qt3DCore::QNode *> nodes; + QList<Qt3DCore::QNode *> nodes; Qt3DCore::QNodeVisitor v; v.traverse(root, [&nodes](Qt3DCore::QNode *node) { Qt3DCore::QNodePrivate *d = Qt3DCore::QNodePrivate::get(node); diff --git a/tests/auto/render/opengl/renderviews/tst_renderviews.cpp b/tests/auto/render/opengl/renderviews/tst_renderviews.cpp index 263940e99..9d4765f8a 100644 --- a/tests/auto/render/opengl/renderviews/tst_renderviews.cpp +++ b/tests/auto/render/opengl/renderviews/tst_renderviews.cpp @@ -144,11 +144,8 @@ private Q_SLOTS: renderer.setNodeManagers(&nodeManagers); renderView.setRenderer(&renderer); - QVector<QSortPolicy::SortType> sortTypes; - sortTypes.push_back(QSortPolicy::BackToFront); - // WHEN - renderView.addSortType(sortTypes); + renderView.addSortType(QList<QSortPolicy::SortType> { QSortPolicy::BackToFront }); EntityRenderCommandDataViewPtr view = EntityRenderCommandDataViewPtr::create(); renderView.setRenderCommandDataView(view); @@ -168,13 +165,9 @@ private Q_SLOTS: RenderView renderView; std::vector<RenderCommand> rawCommands; - QVector<QSortPolicy::SortType> sortTypes; - renderer.setNodeManagers(&nodeManagers); renderView.setRenderer(&renderer); - sortTypes.push_back(QSortPolicy::BackToFront); - for (int i = 0; i < 200; ++i) { RenderCommand c; c.m_depth = float(i); @@ -182,7 +175,7 @@ private Q_SLOTS: } // WHEN - renderView.addSortType(sortTypes); + renderView.addSortType(QList<QSortPolicy::SortType> { QSortPolicy::BackToFront }); EntityRenderCommandDataViewPtr view = EntityRenderCommandDataViewPtr::create(); view->data.commands = rawCommands; @@ -215,13 +208,9 @@ private Q_SLOTS: RenderView renderView; std::vector<RenderCommand> rawCommands; - QVector<QSortPolicy::SortType> sortTypes; - renderer.setNodeManagers(&nodeManagers); renderView.setRenderer(&renderer); - sortTypes.push_back(QSortPolicy::Material); - GLShader *dnas[5] = { reinterpret_cast<GLShader *>(0x250), reinterpret_cast<GLShader *>(0x500), @@ -237,7 +226,7 @@ private Q_SLOTS: } // WHEN - renderView.addSortType(sortTypes); + renderView.addSortType(QList<QSortPolicy::SortType> { QSortPolicy::Material }); EntityRenderCommandDataViewPtr view = EntityRenderCommandDataViewPtr::create(); view->data.commands = rawCommands; @@ -270,9 +259,9 @@ private Q_SLOTS: void checkRenderViewUniformMinification_data() { - QTest::addColumn<QVector<QShaderProgram*>>("shaders"); - QTest::addColumn<QVector<ShaderParameterPack>>("rawParameters"); - QTest::addColumn<QVector<ShaderParameterPack>>("expectedMinimizedParameters"); + QTest::addColumn<QList<QShaderProgram*>>("shaders"); + QTest::addColumn<QList<ShaderParameterPack>>("rawParameters"); + QTest::addColumn<QList<ShaderParameterPack>>("expectedMinimizedParameters"); Qt3DCore::QNodeId fakeTextureNodeId = Qt3DCore::QNodeId::createId(); @@ -290,26 +279,26 @@ private Q_SLOTS: ShaderParameterPack minifiedPack1; QTest::newRow("NoMinification") - << (QVector<QShaderProgram*>() << shader1 << shader2) - << (QVector<ShaderParameterPack>() << pack1 << pack1) - << (QVector<ShaderParameterPack>() << pack1 << pack1); + << QList<QShaderProgram *> { shader1, shader2 } + << QList<ShaderParameterPack> { pack1, pack1 } + << QList<ShaderParameterPack> { pack1, pack1 }; QTest::newRow("SingleShaderMinified") - << (QVector<QShaderProgram*>() << shader1 << shader1 << shader1) - << (QVector<ShaderParameterPack>() << pack1 << pack1 << pack1) - << (QVector<ShaderParameterPack>() << pack1 << minifiedPack1 << minifiedPack1); + << QList<QShaderProgram *> { shader1, shader1, shader1 } + << QList<ShaderParameterPack> { pack1, pack1, pack1 } + << QList<ShaderParameterPack> { pack1, minifiedPack1, minifiedPack1 }; QTest::newRow("MultipleShadersMinified") - << (QVector<QShaderProgram*>() << shader1 << shader1 << shader1 << shader2 << shader2 << shader2) - << (QVector<ShaderParameterPack>() << pack1 << pack1 << pack1 << pack1 << pack1 << pack1) - << (QVector<ShaderParameterPack>() << pack1 << minifiedPack1 << minifiedPack1 << pack1 << minifiedPack1 << minifiedPack1); + << QList<QShaderProgram *> { shader1, shader1, shader1, shader2, shader2, shader2 } + << QList<ShaderParameterPack> { pack1, pack1, pack1, pack1, pack1, pack1 } + << QList<ShaderParameterPack> { pack1, minifiedPack1, minifiedPack1, pack1, minifiedPack1, minifiedPack1 }; } void checkRenderViewUniformMinification() { - QFETCH(QVector<QShaderProgram*>, shaders); - QFETCH(QVector<ShaderParameterPack>, rawParameters); - QFETCH(QVector<ShaderParameterPack>, expectedMinimizedParameters); + QFETCH(QList<QShaderProgram*>, shaders); + QFETCH(QList<ShaderParameterPack>, rawParameters); + QFETCH(QList<ShaderParameterPack>, expectedMinimizedParameters); Qt3DRender::Render::NodeManagers nodeManagers; Renderer renderer; @@ -337,7 +326,7 @@ private Q_SLOTS: } // WHEN - renderView.addSortType((QVector<QSortPolicy::SortType>() << QSortPolicy::Uniform)); + renderView.addSortType(QList<QSortPolicy::SortType> { QSortPolicy::Uniform }); EntityRenderCommandDataViewPtr view = EntityRenderCommandDataViewPtr::create(); view->data.commands = rawCommands; @@ -368,13 +357,9 @@ private Q_SLOTS: RenderView renderView; std::vector<RenderCommand> rawCommands; - QVector<QSortPolicy::SortType> sortTypes; - renderer.setNodeManagers(&nodeManagers); renderView.setRenderer(&renderer); - sortTypes.push_back(QSortPolicy::FrontToBack); - for (int i = 0; i < 200; ++i) { RenderCommand c; c.m_depth = float(i); @@ -382,7 +367,7 @@ private Q_SLOTS: } // WHEN - renderView.addSortType(sortTypes); + renderView.addSortType(QList<QSortPolicy::SortType> { QSortPolicy::FrontToBack }); EntityRenderCommandDataViewPtr view = EntityRenderCommandDataViewPtr::create(); view->data.commands = rawCommands; @@ -415,13 +400,9 @@ private Q_SLOTS: RenderView renderView; std::vector<RenderCommand> rawCommands; - QVector<QSortPolicy::SortType> sortTypes; - renderer.setNodeManagers(&nodeManagers); renderView.setRenderer(&renderer); - sortTypes.push_back(QSortPolicy::StateChangeCost); - for (int i = 0; i < 200; ++i) { RenderCommand c; c.m_changeCost = i; @@ -429,7 +410,7 @@ private Q_SLOTS: } // WHEN - renderView.addSortType(sortTypes); + renderView.addSortType(QList<QSortPolicy::SortType> { QSortPolicy::StateChangeCost }); EntityRenderCommandDataViewPtr view = EntityRenderCommandDataViewPtr::create(); view->data.commands = rawCommands; @@ -463,15 +444,9 @@ private Q_SLOTS: RenderView renderView; std::vector<RenderCommand> rawCommands; - QVector<QSortPolicy::SortType> sortTypes; - renderer.setNodeManagers(&nodeManagers); renderView.setRenderer(&renderer); - sortTypes.push_back(QSortPolicy::StateChangeCost); - sortTypes.push_back(QSortPolicy::Material); - sortTypes.push_back(QSortPolicy::BackToFront); - GLShader *dna[5] = { reinterpret_cast<GLShader *>(0x250), reinterpret_cast<GLShader *>(0x500), @@ -514,7 +489,10 @@ private Q_SLOTS: rawCommands = { c0, c1, c2, c3, c4, c5, c6, c7, c8, c9 }; // WHEN - renderView.addSortType(sortTypes); + renderView.addSortType(QList<QSortPolicy::SortType> + { QSortPolicy::StateChangeCost, + QSortPolicy::Material, + QSortPolicy::BackToFront }); EntityRenderCommandDataViewPtr view = EntityRenderCommandDataViewPtr::create(); view->data.commands = rawCommands; @@ -552,10 +530,6 @@ private Q_SLOTS: { // GIVEN RenderView renderView; - QVector<QSortPolicy::SortType> sortTypes; - - sortTypes.push_back(QSortPolicy::Texture); - Qt3DCore::QNodeId tex1 = Qt3DCore::QNodeId::createId(); Qt3DCore::QNodeId tex2 = Qt3DCore::QNodeId::createId(); @@ -610,7 +584,7 @@ private Q_SLOTS: // WHEN std::vector<RenderCommand> rawCommands = {a, b, c, d, e, f, g}; - renderView.addSortType(sortTypes); + renderView.addSortType(QList<QSortPolicy::SortType> { QSortPolicy::Texture }); EntityRenderCommandDataViewPtr view = EntityRenderCommandDataViewPtr::create(); view->data.commands = rawCommands; diff --git a/tests/auto/render/opengl/textures/tst_textures.cpp b/tests/auto/render/opengl/textures/tst_textures.cpp index f0ca09aa7..0a83edbd7 100644 --- a/tests/auto/render/opengl/textures/tst_textures.cpp +++ b/tests/auto/render/opengl/textures/tst_textures.cpp @@ -177,7 +177,7 @@ class tst_RenderTextures : public Qt3DCore::QBackendNodeTester Q_OBJECT Qt3DRender::QAbstractTexture *createQTexture(int genId, - const QVector<int> &imgGenIds, + const QList<int> &imgGenIds, bool genMipMaps) { TestTexture *tex = new TestTexture(genId); @@ -254,16 +254,16 @@ private Q_SLOTS: renderer.setNodeManagers(mgrs.data()); // GIVEN - QVector<Qt3DRender::QAbstractTexture*> textures; - textures << createQTexture(-1, {1,2}, true); - textures << createQTexture(-1, {1,2}, false); - textures << createQTexture(1, {1,2}, true); - textures << createQTexture(1, {1,2}, false); - textures << createQTexture(1, {1,2,3}, true); - textures << createQTexture(1, {1,2,3}, false); + const QList<Qt3DRender::QAbstractTexture*> textures + = { createQTexture(-1, {1,2}, true), + createQTexture(-1, {1,2}, false), + createQTexture(1, {1,2}, true), + createQTexture(1, {1,2}, false), + createQTexture(1, {1,2,3}, true), + createQTexture(1, {1,2,3}, false) }; // WHEN - QVector<Qt3DRender::Render::Texture*> backend; + QList<Qt3DRender::Render::Texture *> backend; for (auto *t : textures) { Qt3DRender::Render::Texture *backendTexture = createBackendTexture(t, mgrs->textureManager(), @@ -281,7 +281,7 @@ private Q_SLOTS: QVERIFY(renderer.glResourceManagers()->glTextureManager()->lookupResource(backend[i]->peerId()) != renderer.glResourceManagers()->glTextureManager()->lookupResource(backend[k]->peerId())); - QVector<Qt3DRender::Render::OpenGL::GLTexture *> glTextures; + QList<Qt3DRender::Render::OpenGL::GLTexture *> glTextures; for (Qt3DRender::Render::Texture *t : backend) glTextures.push_back(renderer.glResourceManagers()->glTextureManager()->lookupResource(t->peerId())); @@ -383,13 +383,13 @@ private Q_SLOTS: renderer.setNodeManagers(mgrs.data()); // GIVEN - QVector<Qt3DRender::QAbstractTexture*> textures; - textures << createQTexture(1, {1}, true); - textures << createQTexture(2, {1,2}, true); - textures << createQTexture(1, {1,2}, true); + const QList<Qt3DRender::QAbstractTexture*> textures + = { createQTexture(1, {1}, true), + createQTexture(2, {1,2}, true), + createQTexture(1, {1,2}, true) }; // WHEN - QVector<Qt3DRender::Render::Texture*> backend; + QList<Qt3DRender::Render::Texture*> backend; for (auto *t : textures) { Qt3DRender::Render::Texture *backendTexture = createBackendTexture(t, mgrs->textureManager(), diff --git a/tests/auto/render/pickboundingvolumejob/tst_pickboundingvolumejob.cpp b/tests/auto/render/pickboundingvolumejob/tst_pickboundingvolumejob.cpp index 82c2a30c6..919874dd8 100644 --- a/tests/auto/render/pickboundingvolumejob/tst_pickboundingvolumejob.cpp +++ b/tests/auto/render/pickboundingvolumejob/tst_pickboundingvolumejob.cpp @@ -73,11 +73,11 @@ QT_BEGIN_NAMESPACE namespace Qt3DRender { -QVector<Qt3DCore::QNode *> getNodesForCreation(Qt3DCore::QNode *root) +QList<Qt3DCore::QNode *> getNodesForCreation(Qt3DCore::QNode *root) { using namespace Qt3DCore; - QVector<QNode *> nodes; + QList<QNode *> nodes; Qt3DCore::QNodeVisitor visitor; visitor.traverse(root, [&nodes](QNode *node) { nodes.append(node); @@ -97,9 +97,9 @@ QVector<Qt3DCore::QNode *> getNodesForCreation(Qt3DCore::QNode *root) return nodes; } -QVector<Qt3DCore::NodeTreeChange> nodeTreeChangesForNodes(const QVector<Qt3DCore::QNode *> nodes) +QList<Qt3DCore::NodeTreeChange> nodeTreeChangesForNodes(const QList<Qt3DCore::QNode *> nodes) { - QVector<Qt3DCore::NodeTreeChange> nodeTreeChanges; + QList<Qt3DCore::NodeTreeChange> nodeTreeChanges; nodeTreeChanges.reserve(nodes.size()); for (Qt3DCore::QNode *n : nodes) { @@ -132,7 +132,7 @@ public: aed->m_root = proot; aed->initialize(); aed->initNodeTree(root); - const QVector<Qt3DCore::QNode *> nodes = getNodesForCreation(root); + const QList<Qt3DCore::QNode *> nodes = getNodesForCreation(root); aed->m_aspectManager->setRootEntity(proot.data(), nodes); Render::Entity *rootEntity = nodeManagers()->lookupResource<Render::Entity, Render::EntityManager>(rootEntityId()); @@ -180,8 +180,8 @@ public: }); } Qt3DCore::QNode *lookupNode(Qt3DCore::QNodeId id) const override { return m_frontEndNodes.value(id, nullptr); } - QVector<Qt3DCore::QNode *> lookupNodes(const QVector<Qt3DCore::QNodeId> &ids) const override { - QVector<Qt3DCore::QNode *> res; + QList<Qt3DCore::QNode *> lookupNodes(const QList<Qt3DCore::QNodeId> &ids) const override { + QList<Qt3DCore::QNode *> res; for (const auto &id: ids) { auto node = m_frontEndNodes.value(id, nullptr); if (node) diff --git a/tests/auto/render/qcamera/tst_qcamera.cpp b/tests/auto/render/qcamera/tst_qcamera.cpp index 1e8e7cd9b..26a103c95 100644 --- a/tests/auto/render/qcamera/tst_qcamera.cpp +++ b/tests/auto/render/qcamera/tst_qcamera.cpp @@ -54,11 +54,11 @@ QT_BEGIN_NAMESPACE namespace Qt3DRender { -QVector<Qt3DCore::QNode *> getNodesForCreation(Qt3DCore::QNode *root) +QList<Qt3DCore::QNode *> getNodesForCreation(Qt3DCore::QNode *root) { using namespace Qt3DCore; - QVector<QNode *> nodes; + QList<QNode *> nodes; Qt3DCore::QNodeVisitor visitor; visitor.traverse(root, [&nodes](QNode *node) { nodes.append(node); @@ -78,9 +78,9 @@ QVector<Qt3DCore::QNode *> getNodesForCreation(Qt3DCore::QNode *root) return nodes; } -QVector<Qt3DCore::NodeTreeChange> nodeTreeChangesForNodes(const QVector<Qt3DCore::QNode *> nodes) +QList<Qt3DCore::NodeTreeChange> nodeTreeChangesForNodes(const QList<Qt3DCore::QNode *> nodes) { - QVector<Qt3DCore::NodeTreeChange> nodeTreeChanges; + QList<Qt3DCore::NodeTreeChange> nodeTreeChanges; nodeTreeChanges.reserve(nodes.size()); for (Qt3DCore::QNode *n : nodes) { @@ -104,7 +104,7 @@ public: { QRenderAspect::onRegistered(); - const QVector<Qt3DCore::QNode *> nodes = getNodesForCreation(root); + const QList<Qt3DCore::QNode *> nodes = getNodesForCreation(root); d_func()->setRootAndCreateNodes(qobject_cast<Qt3DCore::QEntity *>(root), nodeTreeChangesForNodes(nodes)); Render::Entity *rootEntity = nodeManagers()->lookupResource<Render::Entity, Render::EntityManager>(rootEntityId()); diff --git a/tests/auto/render/qlevelofdetail/tst_qlevelofdetail.cpp b/tests/auto/render/qlevelofdetail/tst_qlevelofdetail.cpp index 0c68cf42c..1ca307e7c 100644 --- a/tests/auto/render/qlevelofdetail/tst_qlevelofdetail.cpp +++ b/tests/auto/render/qlevelofdetail/tst_qlevelofdetail.cpp @@ -62,7 +62,7 @@ private Q_SLOTS: { // WHEN - QVector<qreal> thresholds = {10., 20., 30.}; + const QList<qreal> thresholds = { 10., 20., 30. }; lod->setThresholds(thresholds); QCoreApplication::processEvents(); diff --git a/tests/auto/render/qmaterial/tst_qmaterial.cpp b/tests/auto/render/qmaterial/tst_qmaterial.cpp index 50e2d9989..58831efd4 100644 --- a/tests/auto/render/qmaterial/tst_qmaterial.cpp +++ b/tests/auto/render/qmaterial/tst_qmaterial.cpp @@ -138,7 +138,7 @@ private: } } - void compareFilterKeys(const QVector<Qt3DRender::QFilterKey *> &original, const QVector<Qt3DRender::QFilterKey *> &clone) + void compareFilterKeys(const QList<Qt3DRender::QFilterKey *> &original, const QList<Qt3DRender::QFilterKey *> &clone) { const int annotationsCount = original.size(); QCOMPARE(annotationsCount, clone.size()); @@ -152,7 +152,7 @@ private: } } - void compareRenderStates(const QVector<Qt3DRender::QRenderState *> &original, const QVector<Qt3DRender::QRenderState *> &clone) + void compareRenderStates(const QList<Qt3DRender::QRenderState *> &original, const QList<Qt3DRender::QRenderState *> &clone) { const int renderStatesCount = original.size(); QCOMPARE(renderStatesCount, clone.size()); diff --git a/tests/auto/render/qrenderstate/tst_qrenderstate.cpp b/tests/auto/render/qrenderstate/tst_qrenderstate.cpp index f18488f9a..64ad63e3a 100644 --- a/tests/auto/render/qrenderstate/tst_qrenderstate.cpp +++ b/tests/auto/render/qrenderstate/tst_qrenderstate.cpp @@ -225,7 +225,7 @@ private Q_SLOTS: qRegisterMetaType<QStencilOperationArguments*>("QStencilOperationArguments*"); qRegisterMetaType<QStencilTestArguments*>("QStencilTestArguments*"); - for (bool front : QVector<bool>{false, true}) { + for (bool front : QList<bool> { false, true }) { const char *argsProperty = front ? "front" : "back"; addStencilTestCase<QStencilOperation, QStencilOperationArguments>( diff --git a/tests/auto/render/qrendertargetselector/tst_qrendertargetselector.cpp b/tests/auto/render/qrendertargetselector/tst_qrendertargetselector.cpp index af5b29bd2..975b96403 100644 --- a/tests/auto/render/qrendertargetselector/tst_qrendertargetselector.cpp +++ b/tests/auto/render/qrendertargetselector/tst_qrendertargetselector.cpp @@ -86,7 +86,7 @@ private Q_SLOTS: arbiter.clear(); // WHEN - QVector<Qt3DRender::QRenderTargetOutput::AttachmentPoint> outputs; + QList<Qt3DRender::QRenderTargetOutput::AttachmentPoint> outputs; outputs << Qt3DRender::QRenderTargetOutput::Color0 << Qt3DRender::QRenderTargetOutput::Depth; renderTargetSelector->setOutputs(outputs); QCoreApplication::processEvents(); @@ -105,7 +105,7 @@ private Q_SLOTS: QCOMPARE(arbiter.dirtyNodes().size(), 0); // WHEN - renderTargetSelector->setOutputs(QVector<Qt3DRender::QRenderTargetOutput::AttachmentPoint>()); + renderTargetSelector->setOutputs(QList<Qt3DRender::QRenderTargetOutput::AttachmentPoint>()); QCoreApplication::processEvents(); // THEN diff --git a/tests/auto/render/qsortpolicy/tst_qsortpolicy.cpp b/tests/auto/render/qsortpolicy/tst_qsortpolicy.cpp index 02bbeffd8..43168b74c 100644 --- a/tests/auto/render/qsortpolicy/tst_qsortpolicy.cpp +++ b/tests/auto/render/qsortpolicy/tst_qsortpolicy.cpp @@ -59,11 +59,11 @@ private Q_SLOTS: arbiter.setArbiterOnNode(sortPolicy.data()); // WHEN - auto sortTypes = QVector<Qt3DRender::QSortPolicy::SortType>() << Qt3DRender::QSortPolicy::BackToFront - << Qt3DRender::QSortPolicy::Material - << Qt3DRender::QSortPolicy::Material - << Qt3DRender::QSortPolicy::FrontToBack; - auto sortTypesInt = QVector<int>(); + const QList<Qt3DRender::QSortPolicy::SortType> sortTypes = { Qt3DRender::QSortPolicy::BackToFront, + Qt3DRender::QSortPolicy::Material, + Qt3DRender::QSortPolicy::Material, + Qt3DRender::QSortPolicy::FrontToBack }; + auto sortTypesInt = QList<int>(); transformVector(sortTypes, sortTypesInt); sortPolicy->setSortTypes(sortTypes); QCoreApplication::processEvents(); diff --git a/tests/auto/render/raycasting/tst_raycasting.cpp b/tests/auto/render/raycasting/tst_raycasting.cpp index 0cc8ae4dd..7fe8a32ba 100644 --- a/tests/auto/render/raycasting/tst_raycasting.cpp +++ b/tests/auto/render/raycasting/tst_raycasting.cpp @@ -63,7 +63,7 @@ private Q_SLOTS: private: Sphere *volumeAt(int index); - QVector<Sphere> boundingVolumes; + QList<Sphere> boundingVolumes; }; void tst_RayCasting::shouldIntersect_data() @@ -105,17 +105,17 @@ void tst_RayCasting::shouldIntersect() class MyBoudingVolumesProvider : public QBoundingVolumeProvider { public: - MyBoudingVolumesProvider(QVector<QBoundingVolume *> volumes) + MyBoudingVolumesProvider(QList<QBoundingVolume *> volumes) : m_volumes(volumes) {} - QVector<QBoundingVolume *> boundingVolumes() const override + QList<QBoundingVolume *> boundingVolumes() const override { return m_volumes; } private: - QVector<QBoundingVolume *> m_volumes; + QList<QBoundingVolume *> m_volumes; }; void tst_RayCasting::shouldReturnValidHandle() @@ -123,7 +123,7 @@ void tst_RayCasting::shouldReturnValidHandle() // GIVEN QRay3D ray; Sphere v1; - MyBoudingVolumesProvider provider = QVector<QBoundingVolume *>() << &v1; + MyBoudingVolumesProvider provider = QList<QBoundingVolume *> { &v1 }; QRayCastingService service; @@ -143,7 +143,7 @@ void tst_RayCasting::shouldReturnResultForEachHandle() { // GIVEN QRay3D ray; - QVector<QBoundingVolume *> volumes; + QList<QBoundingVolume *> volumes; MyBoudingVolumesProvider provider(volumes); QRayCastingService service; @@ -168,12 +168,12 @@ void tst_RayCasting::shouldReturnAllResults() { // GIVEN QRay3D ray; - QVector<QBoundingVolume *> volumes; + QList<QBoundingVolume *> volumes; MyBoudingVolumesProvider provider(volumes); QRayCastingService service; - QVector<QQueryHandle> handles; + QList<QQueryHandle> handles; handles.append(service.query(ray, QAbstractCollisionQueryService::AllHits, &provider)); @@ -182,7 +182,7 @@ void tst_RayCasting::shouldReturnAllResults() &provider)); // WHEN - const QVector<QCollisionQueryResult> results = service.fetchAllResults(); + const QList<QCollisionQueryResult> results = service.fetchAllResults(); // THEN bool expectedHandlesFound = true; @@ -202,53 +202,54 @@ void tst_RayCasting::shouldReturnAllResults() void tst_RayCasting::shouldReturnHits_data() { QTest::addColumn<QRay3D>("ray"); - QTest::addColumn<QVector<QBoundingVolume *> >("volumes"); + QTest::addColumn<QList<QBoundingVolume *>>("volumes"); QTest::addColumn<std::vector<QNodeId> >("hits"); - QTest::addColumn<QAbstractCollisionQueryService::QueryMode >("queryMode"); + QTest::addColumn<QAbstractCollisionQueryService::QueryMode>("queryMode"); QRay3D ray(Vector3D(1, 1, 1), Vector3D(0, 0, 1)); this->boundingVolumes.clear(); - this->boundingVolumes.append(QVector<Sphere>() << Sphere(Vector3D(1, 1, 1), 3, QNodeId::createId()) - << Sphere(Vector3D(0, 0, 0), 3, QNodeId::createId()) - << Sphere(Vector3D(0, 1, 3), 1, QNodeId::createId()) - << Sphere(Vector3D(4, 4, 5), 1, QNodeId::createId()) - << Sphere(Vector3D(2, 2, 11), 5, QNodeId::createId()) - << Sphere(Vector3D(2, 2, 13), 1, QNodeId::createId()) - << Sphere(Vector3D(2, 2, 15), 5, QNodeId::createId())); + this->boundingVolumes.append(QList<Sphere> + { Sphere(Vector3D(1, 1, 1), 3, QNodeId::createId()), + Sphere(Vector3D(0, 0, 0), 3, QNodeId::createId()), + Sphere(Vector3D(0, 1, 3), 1, QNodeId::createId()), + Sphere(Vector3D(4, 4, 5), 1, QNodeId::createId()), + Sphere(Vector3D(2, 2, 11), 5, QNodeId::createId()), + Sphere(Vector3D(2, 2, 13), 1, QNodeId::createId()), + Sphere(Vector3D(2, 2, 15), 5, QNodeId::createId()) }); QTest::newRow("All hits, One sphere intersect") << ray - << (QVector<QBoundingVolume *>{ volumeAt(0), volumeAt(3) }) + << (QList<QBoundingVolume *> { volumeAt(0), volumeAt(3) }) << (std::vector<QNodeId>{ volumeAt(0)->id() }) << QAbstractCollisionQueryService::AllHits; QTest::newRow("All hits, Three sphere intersect") << ray - << (QVector<QBoundingVolume *>{ volumeAt(0), volumeAt(3), volumeAt(6), volumeAt(2) }) + << (QList<QBoundingVolume *> { volumeAt(0), volumeAt(3), volumeAt(6), volumeAt(2) }) << (std::vector<QNodeId>{ volumeAt(0)->id(), volumeAt(2)->id(), volumeAt(6)->id() }) << QAbstractCollisionQueryService::AllHits; QTest::newRow("All hits, No sphere intersect") << ray - << (QVector<QBoundingVolume *>{ volumeAt(3), volumeAt(5) }) + << (QList<QBoundingVolume *> { volumeAt(3), volumeAt(5) }) << (std::vector<QNodeId>{}) << QAbstractCollisionQueryService::AllHits; QTest::newRow("Sphere 1 intersect, returns First Hit") << ray - << (QVector<QBoundingVolume *>{ volumeAt(0), volumeAt(3), volumeAt(6) }) + << (QList<QBoundingVolume *> { volumeAt(0), volumeAt(3), volumeAt(6) }) << (std::vector<QNodeId>{ volumeAt(0)->id() }) << QAbstractCollisionQueryService::FirstHit; QTest::newRow("Sphere 3 and 5 intersects, returns First Hit") << ray - << (QVector<QBoundingVolume *>{ volumeAt(3), volumeAt(6), volumeAt(4) }) + << (QList<QBoundingVolume *> { volumeAt(3), volumeAt(6), volumeAt(4) }) << (std::vector<QNodeId>{ volumeAt(4)->id() }) << QAbstractCollisionQueryService::FirstHit; QTest::newRow("Sphere 5 and 3 intersects, unordered list, returns First Hit") << ray - << (QVector<QBoundingVolume *>{ volumeAt(4), volumeAt(3), volumeAt(6) }) + << (QList<QBoundingVolume *> { volumeAt(4), volumeAt(3), volumeAt(6) }) << (std::vector<QNodeId>{volumeAt(4)->id() }) << QAbstractCollisionQueryService::FirstHit; QTest::newRow("No sphere intersect, returns First Hit") << ray - << (QVector<QBoundingVolume *>{ volumeAt(3), volumeAt(5) }) + << (QList<QBoundingVolume *> { volumeAt(3), volumeAt(5) }) << (std::vector<QNodeId>{}) << QAbstractCollisionQueryService::FirstHit; } @@ -257,7 +258,7 @@ void tst_RayCasting::shouldReturnHits() { // GIVEN QFETCH(QRay3D, ray); - QFETCH(QVector<QBoundingVolume *>, volumes); + QFETCH(QList<QBoundingVolume *>, volumes); QFETCH(std::vector<QNodeId>, hits); QFETCH(QAbstractCollisionQueryService::QueryMode, queryMode); @@ -282,7 +283,7 @@ void tst_RayCasting::shouldUseProvidedBoudingVolumes() Sphere sphere3(Vector3D(0, 1, 3), 1); Sphere sphere4(Vector3D(4, 4, 5), 1); - MyBoudingVolumesProvider provider(QVector<QBoundingVolume *>() << &sphere1 << &sphere4 << &sphere3); + MyBoudingVolumesProvider provider(QList<QBoundingVolume *> { &sphere1, &sphere4, &sphere3 }); std::vector<QNodeId> hits{ sphere1.id(), sphere3.id()}; QRayCastingService service; diff --git a/tests/auto/render/raycastingjob/tst_raycastingjob.cpp b/tests/auto/render/raycastingjob/tst_raycastingjob.cpp index 247b4a82e..5590368e8 100644 --- a/tests/auto/render/raycastingjob/tst_raycastingjob.cpp +++ b/tests/auto/render/raycastingjob/tst_raycastingjob.cpp @@ -65,11 +65,11 @@ QT_BEGIN_NAMESPACE namespace Qt3DRender { -QVector<Qt3DCore::QNode *> getNodesForCreation(Qt3DCore::QNode *root) +QList<Qt3DCore::QNode *> getNodesForCreation(Qt3DCore::QNode *root) { using namespace Qt3DCore; - QVector<QNode *> nodes; + QList<QNode *> nodes; Qt3DCore::QNodeVisitor visitor; visitor.traverse(root, [&nodes](QNode *node) { nodes.append(node); @@ -89,9 +89,9 @@ QVector<Qt3DCore::QNode *> getNodesForCreation(Qt3DCore::QNode *root) return nodes; } -QVector<Qt3DCore::NodeTreeChange> nodeTreeChangesForNodes(const QVector<Qt3DCore::QNode *> nodes) +QList<Qt3DCore::NodeTreeChange> nodeTreeChangesForNodes(const QList<Qt3DCore::QNode *> nodes) { - QVector<Qt3DCore::NodeTreeChange> nodeTreeChanges; + QList<Qt3DCore::NodeTreeChange> nodeTreeChanges; nodeTreeChanges.reserve(nodes.size()); for (Qt3DCore::QNode *n : nodes) { @@ -124,7 +124,7 @@ public: aed->m_root = proot; aed->initialize(); aed->initNodeTree(root); - const QVector<Qt3DCore::QNode *> nodes = getNodesForCreation(root); + const QList<Qt3DCore::QNode *> nodes = getNodesForCreation(root); aed->m_aspectManager->setRootEntity(proot.data(), nodes); Render::Entity *rootEntity = nodeManagers()->lookupResource<Render::Entity, Render::EntityManager>(rootEntityId()); @@ -173,8 +173,8 @@ public: }); } Qt3DCore::QNode *lookupNode(Qt3DCore::QNodeId id) const override { return m_frontEndNodes.value(id, nullptr); } - QVector<Qt3DCore::QNode *> lookupNodes(const QVector<Qt3DCore::QNodeId> &ids) const override { - QVector<Qt3DCore::QNode *> res; + QList<Qt3DCore::QNode *> lookupNodes(const QList<Qt3DCore::QNodeId> &ids) const override { + QList<Qt3DCore::QNode *> res; for (const auto &id: ids) { auto node = m_frontEndNodes.value(id, nullptr); if (node) diff --git a/tests/auto/render/rendertarget/tst_rendertarget.cpp b/tests/auto/render/rendertarget/tst_rendertarget.cpp index 8170c022a..265663d1b 100644 --- a/tests/auto/render/rendertarget/tst_rendertarget.cpp +++ b/tests/auto/render/rendertarget/tst_rendertarget.cpp @@ -86,7 +86,7 @@ private Q_SLOTS: // THEN QCOMPARE(backendRenderTarget.isEnabled(), true); QCOMPARE(backendRenderTarget.peerId(), renderTarget.id()); - QCOMPARE(backendRenderTarget.renderOutputs(), QVector<Qt3DCore::QNodeId>() << renderTargetOuput.id()); + QCOMPARE(backendRenderTarget.renderOutputs(), (QList<Qt3DCore::QNodeId> { renderTargetOuput.id() })); } { // WHEN diff --git a/tests/auto/render/scene2d/tst_scene2d.cpp b/tests/auto/render/scene2d/tst_scene2d.cpp index ac7ebb868..dfd602027 100644 --- a/tests/auto/render/scene2d/tst_scene2d.cpp +++ b/tests/auto/render/scene2d/tst_scene2d.cpp @@ -88,8 +88,8 @@ public: } private: - QVector<QEvent::Type> m_eventTypes; - QVector<QPointF> m_mousePoints; + QList<QEvent::Type> m_eventTypes; + QList<QPointF> m_mousePoints; }; class tst_Scene2D : public Qt3DCore::QBackendNodeTester diff --git a/tests/auto/render/segmentvisitor/tst_segmentvisitor.cpp b/tests/auto/render/segmentvisitor/tst_segmentvisitor.cpp index 7283f7a0a..47d7b7420 100644 --- a/tests/auto/render/segmentvisitor/tst_segmentvisitor.cpp +++ b/tests/auto/render/segmentvisitor/tst_segmentvisitor.cpp @@ -101,7 +101,7 @@ private: abc[1] = b; } }; - QVector<TestSegment> m_segments; + QList<TestSegment> m_segments; }; class tst_SegmentVisitor : public Qt3DCore::QBackendNodeTester diff --git a/tests/auto/render/shadergraph/qshadergenerator/tst_qshadergenerator.cpp b/tests/auto/render/shadergraph/qshadergenerator/tst_qshadergenerator.cpp index 90906f4e9..db5c0a910 100644 --- a/tests/auto/render/shadergraph/qshadergenerator/tst_qshadergenerator.cpp +++ b/tests/auto/render/shadergraph/qshadergenerator/tst_qshadergenerator.cpp @@ -54,7 +54,7 @@ namespace return port; } - QShaderNode createNode(const QVector<QShaderNodePort> &ports, const QStringList &layers = QStringList()) + QShaderNode createNode(const QList<QShaderNodePort> &ports, const QStringList &layers = QStringList()) { auto node = QShaderNode(); node.setUuid(QUuid::createUuid()); diff --git a/tests/auto/render/shadergraph/qshadergraph/tst_qshadergraph.cpp b/tests/auto/render/shadergraph/qshadergraph/tst_qshadergraph.cpp index e21b57577..b964731c0 100644 --- a/tests/auto/render/shadergraph/qshadergraph/tst_qshadergraph.cpp +++ b/tests/auto/render/shadergraph/qshadergraph/tst_qshadergraph.cpp @@ -42,7 +42,7 @@ namespace return port; } - QShaderNode createNode(const QVector<QShaderNodePort> &ports, const QStringList &layers = QStringList()) + QShaderNode createNode(const QList<QShaderNodePort> &ports, const QStringList &layers = QStringList()) { auto node = QShaderNode(); node.setUuid(QUuid::createUuid()); @@ -66,8 +66,8 @@ namespace } QShaderGraph::Statement createStatement(const QShaderNode &node, - const QVector<int> &inputs = QVector<int>(), - const QVector<int> &outputs = QVector<int>()) + const QList<int> &inputs = QList<int>(), + const QList<int> &outputs = QList<int>()) { auto statement = QShaderGraph::Statement(); statement.node = node; @@ -81,7 +81,7 @@ namespace qDebug() << prefix << statement.inputs << statement.uuid().toString() << statement.outputs; } - void dumpStatementsIfNeeded(const QVector<QShaderGraph::Statement> &statements, const QVector<QShaderGraph::Statement> &expected) + void dumpStatementsIfNeeded(const QList<QShaderGraph::Statement> &statements, const QList<QShaderGraph::Statement> &expected) { if (statements != expected) { for (int i = 0; i < qMax(statements.size(), expected.size()); i++) { @@ -466,14 +466,14 @@ void tst_QShaderGraph::shouldSerializeGraphForCodeGeneration() const auto statements = graph.createStatements(); // THEN - const auto expected = QVector<QShaderGraph::Statement>() - << createStatement(input2, {}, {1}) - << createStatement(input1, {}, {0}) - << createStatement(function2, {0, 1}, {3}) - << createStatement(function1, {0}, {2}) - << createStatement(function3, {2, 3}, {4, 5}) - << createStatement(output2, {5}, {}) - << createStatement(output1, {4}, {}); + const QList<QShaderGraph::Statement> expected + = { createStatement(input2, {}, {1}), + createStatement(input1, {}, {0}), + createStatement(function2, {0, 1}, {3}), + createStatement(function1, {0}, {2}), + createStatement(function3, {2, 3}, {4, 5}), + createStatement(output2, {5}, {}), + createStatement(output1, {4}, {}) }; dumpStatementsIfNeeded(statements, expected); QCOMPARE(statements, expected); } @@ -519,8 +519,7 @@ void tst_QShaderGraph::shouldHandleUnboundPortsDuringGraphSerialization() // THEN // Note that no statement has any unbound input - const auto expected = QVector<QShaderGraph::Statement>() - << createStatement(input, {}, {0}); + const QList<QShaderGraph::Statement> expected = { createStatement(input, {}, {0}) }; dumpStatementsIfNeeded(statements, expected); QCOMPARE(statements, expected); } @@ -568,7 +567,7 @@ void tst_QShaderGraph::shouldSurviveCyclesDuringGraphSerialization() // THEN // The cycle is ignored - const auto expected = QVector<QShaderGraph::Statement>(); + const QList<QShaderGraph::Statement> expected; dumpStatementsIfNeeded(statements, expected); QCOMPARE(statements, expected); } @@ -643,16 +642,16 @@ void tst_QShaderGraph::shouldDealWithEdgesJumpingOverLayers() const auto statements = graph.createStatements(); // THEN - const auto expected = QVector<QShaderGraph::Statement>() - << createStatement(texCoord, {}, {2}) - << createStatement(texture, {}, {1}) - << createStatement(lightIntensity, {}, {3}) - << createStatement(sampleTexture, {1, 2}, {5}) - << createStatement(worldPosition, {}, {0}) - << createStatement(exposure, {}, {4}) - << createStatement(lightFunction, {5, 0, 3}, {6}) - << createStatement(exposureFunction, {6, 4}, {7}) - << createStatement(fragColor, {7}, {}); + const QList<QShaderGraph::Statement> expected + = { createStatement(texCoord, {}, {2}), + createStatement(texture, {}, {1}), + createStatement(lightIntensity, {}, {3}), + createStatement(sampleTexture, {1, 2}, {5}), + createStatement(worldPosition, {}, {0}), + createStatement(exposure, {}, {4}), + createStatement(lightFunction, {5, 0, 3}, {6}), + createStatement(exposureFunction, {6, 4}, {7}), + createStatement(fragColor, {7}, {}) }; dumpStatementsIfNeeded(statements, expected); QCOMPARE(statements, expected); } @@ -718,11 +717,11 @@ void tst_QShaderGraph::shouldGenerateDifferentStatementsDependingOnActiveLayers( const auto statements = graph.createStatements({"diffuseUniform", "normalUniform"}); // THEN - const auto expected = QVector<QShaderGraph::Statement>() - << createStatement(normalUniform, {}, {1}) - << createStatement(diffuseUniform, {}, {0}) - << createStatement(lightFunction, {0, 1}, {2}) - << createStatement(fragColor, {2}, {}); + const QList<QShaderGraph::Statement> expected + = { createStatement(normalUniform, {}, {1}), + createStatement(diffuseUniform, {}, {0}), + createStatement(lightFunction, {0, 1}, {2}), + createStatement(fragColor, {2}, {}) }; dumpStatementsIfNeeded(statements, expected); QCOMPARE(statements, expected); } @@ -732,12 +731,12 @@ void tst_QShaderGraph::shouldGenerateDifferentStatementsDependingOnActiveLayers( const auto statements = graph.createStatements({"diffuseUniform", "normalTexture"}); // THEN - const auto expected = QVector<QShaderGraph::Statement>() - << createStatement(texCoord, {}, {0}) - << createStatement(normalTexture, {0}, {2}) - << createStatement(diffuseUniform, {}, {1}) - << createStatement(lightFunction, {1, 2}, {3}) - << createStatement(fragColor, {3}, {}); + const QList<QShaderGraph::Statement> expected + = { createStatement(texCoord, {}, {0}), + createStatement(normalTexture, {0}, {2}), + createStatement(diffuseUniform, {}, {1}), + createStatement(lightFunction, {1, 2}, {3}), + createStatement(fragColor, {3}, {}) }; dumpStatementsIfNeeded(statements, expected); QCOMPARE(statements, expected); } @@ -747,12 +746,12 @@ void tst_QShaderGraph::shouldGenerateDifferentStatementsDependingOnActiveLayers( const auto statements = graph.createStatements({"diffuseTexture", "normalUniform"}); // THEN - const auto expected = QVector<QShaderGraph::Statement>() - << createStatement(texCoord, {}, {0}) - << createStatement(normalUniform, {}, {2}) - << createStatement(diffuseTexture, {0}, {1}) - << createStatement(lightFunction, {1, 2}, {3}) - << createStatement(fragColor, {3}, {}); + const QList<QShaderGraph::Statement> expected + = { createStatement(texCoord, {}, {0}), + createStatement(normalUniform, {}, {2}), + createStatement(diffuseTexture, {0}, {1}), + createStatement(lightFunction, {1, 2}, {3}), + createStatement(fragColor, {3}, {}) }; dumpStatementsIfNeeded(statements, expected); QCOMPARE(statements, expected); } @@ -762,12 +761,12 @@ void tst_QShaderGraph::shouldGenerateDifferentStatementsDependingOnActiveLayers( const auto statements = graph.createStatements({"diffuseTexture", "normalTexture"}); // THEN - const auto expected = QVector<QShaderGraph::Statement>() - << createStatement(texCoord, {}, {0}) - << createStatement(normalTexture, {0}, {2}) - << createStatement(diffuseTexture, {0}, {1}) - << createStatement(lightFunction, {1, 2}, {3}) - << createStatement(fragColor, {3}, {}); + const QList<QShaderGraph::Statement> expected + = { createStatement(texCoord, {}, {0}), + createStatement(normalTexture, {0}, {2}), + createStatement(diffuseTexture, {0}, {1}), + createStatement(lightFunction, {1, 2}, {3}), + createStatement(fragColor, {3}, {}) }; dumpStatementsIfNeeded(statements, expected); QCOMPARE(statements, expected); } @@ -808,11 +807,11 @@ void tst_QShaderGraph::shouldDealWithBranchesWithoutOutput() // THEN // Note that no edge leads to the unbound input - const auto expected = QVector<QShaderGraph::Statement>() - << createStatement(input, {}, {0}) - << createStatement(function, {0}, {1}) - << createStatement(output, {1}, {}) - << createStatement(danglingFunction, {0}, {2}); + const QList<QShaderGraph::Statement> expected + = { createStatement(input, {}, {0}), + createStatement(function, {0}, {1}), + createStatement(output, {1}, {}), + createStatement(danglingFunction, {0}, {2}) }; dumpStatementsIfNeeded(statements, expected); QCOMPARE(statements, expected); } @@ -852,10 +851,10 @@ void tst_QShaderGraph::shouldDiscardEdgesConnectedToDiscardedNodes() const auto statements = graph.createStatements({"0"}); // THEN - const auto expected = QVector<QShaderGraph::Statement>() - << createStatement(input, {}, {0}) - << createStatement(function0, {0}, {1}) - << createStatement(output, {1}, {}); + const QList<QShaderGraph::Statement> expected + = { createStatement(input, {}, {0}), + createStatement(function0, {0}, {1}), + createStatement(output, {1}, {}) }; dumpStatementsIfNeeded(statements, expected); QCOMPARE(statements, expected); } diff --git a/tests/auto/render/shadergraph/qshadergraphloader/tst_qshadergraphloader.cpp b/tests/auto/render/shadergraph/qshadergraphloader/tst_qshadergraphloader.cpp index 71f5130de..d4f35dca3 100644 --- a/tests/auto/render/shadergraph/qshadergraphloader/tst_qshadergraphloader.cpp +++ b/tests/auto/render/shadergraph/qshadergraphloader/tst_qshadergraphloader.cpp @@ -69,7 +69,7 @@ namespace return port; } - QShaderNode createNode(const QVector<QShaderNodePort> &ports, const QStringList &layers = QStringList()) + QShaderNode createNode(const QList<QShaderNodePort> &ports, const QStringList &layers = QStringList()) { auto node = QShaderNode(); node.setUuid(QUuid::createUuid()); @@ -218,7 +218,7 @@ namespace qDebug() << prefix << statement.inputs << statement.uuid().toString() << statement.outputs; } - void dumpStatementsIfNeeded(const QVector<QShaderGraph::Statement> &statements, const QVector<QShaderGraph::Statement> &expected) + void dumpStatementsIfNeeded(const QList<QShaderGraph::Statement> &statements, const QList<QShaderGraph::Statement> &expected) { if (statements != expected) { for (int i = 0; i < qMax(statements.size(), expected.size()); i++) { diff --git a/tests/auto/render/shadergraph/qshadernodesloader/tst_qshadernodesloader.cpp b/tests/auto/render/shadergraph/qshadernodesloader/tst_qshadernodesloader.cpp index 84da03fdb..feaa6c5f0 100644 --- a/tests/auto/render/shadergraph/qshadernodesloader/tst_qshadernodesloader.cpp +++ b/tests/auto/render/shadergraph/qshadernodesloader/tst_qshadernodesloader.cpp @@ -74,7 +74,7 @@ namespace return port; } - QShaderNode createNode(const QVector<QShaderNodePort> &ports) + QShaderNode createNode(const QList<QShaderNodePort> &ports) { auto node = QShaderNode(); for (const auto &port : ports) diff --git a/tests/auto/render/sortpolicy/tst_sortpolicy.cpp b/tests/auto/render/sortpolicy/tst_sortpolicy.cpp index b6ee78f41..633a45871 100644 --- a/tests/auto/render/sortpolicy/tst_sortpolicy.cpp +++ b/tests/auto/render/sortpolicy/tst_sortpolicy.cpp @@ -60,8 +60,9 @@ private Q_SLOTS: Qt3DRender::Render::FrameGraphManager manager; manager.appendNode(parent.id(), parentBackend); - const auto sortTypes = QVector<Qt3DRender::QSortPolicy::SortType>() << Qt3DRender::QSortPolicy::BackToFront - << Qt3DRender::QSortPolicy::Material; + const QList<Qt3DRender::QSortPolicy::SortType> sortTypes + = { Qt3DRender::QSortPolicy::BackToFront, + Qt3DRender::QSortPolicy::Material }; Qt3DRender::Render::SortPolicy backendNode; backendNode.setFrameGraphManager(&manager); Qt3DRender::QSortPolicy sortPolicy(&parent); @@ -81,8 +82,9 @@ private Q_SLOTS: void checkPropertyChanges() { // GIVEN - const auto sortTypes = QVector<Qt3DRender::QSortPolicy::SortType>() << Qt3DRender::QSortPolicy::BackToFront - << Qt3DRender::QSortPolicy::Material; + const QList<Qt3DRender::QSortPolicy::SortType> sortTypes + = { Qt3DRender::QSortPolicy::BackToFront, + Qt3DRender::QSortPolicy::Material }; TestRenderer renderer; Qt3DRender::Render::SortPolicy backendNode; backendNode.setRenderer(&renderer); diff --git a/tests/auto/render/trianglevisitor/tst_trianglevisitor.cpp b/tests/auto/render/trianglevisitor/tst_trianglevisitor.cpp index 058df8887..f77fddfbf 100644 --- a/tests/auto/render/trianglevisitor/tst_trianglevisitor.cpp +++ b/tests/auto/render/trianglevisitor/tst_trianglevisitor.cpp @@ -105,7 +105,7 @@ private: abc[2] = c; } }; - QVector<TestTriangle> m_triangles; + QList<TestTriangle> m_triangles; }; class tst_TriangleVisitor : public Qt3DCore::QBackendNodeTester diff --git a/tests/auto/render/uniform/tst_uniform.cpp b/tests/auto/render/uniform/tst_uniform.cpp index 287c0cf11..3a3ee5667 100644 --- a/tests/auto/render/uniform/tst_uniform.cpp +++ b/tests/auto/render/uniform/tst_uniform.cpp @@ -133,7 +133,7 @@ private Q_SLOTS: QMatrix4x4 m4; m4.translate(1.0f, 2.0f, 3.0f); - const QVector<QMatrix4x4> matrices = (QVector<QMatrix4x4>() << m1 << m2 << m3 << m4); + const QList<QMatrix4x4> matrices = { m1, m2, m3, m4 }; UniformValue v(matrices); // THEN @@ -389,11 +389,11 @@ private Q_SLOTS: QMatrix4x4 m4; m4.translate(1.0f, 2.0f, 3.0f); - const QVector<QMatrix4x4> matrices1 = (QVector<QMatrix4x4>() << m1 << m2 << m3 << m4); + const QList<QMatrix4x4> matrices1 = { m1, m2, m3, m4 }; UniformValue v(matrices1); // WHEN - const QVector<QMatrix4x4> matrices2 = (QVector<QMatrix4x4>() << m4 << m3 << m2 << m1 << m4); + const QList<QMatrix4x4> matrices2 = { m4, m3, m2, m1, m4 }; v.setData(matrices2); // THEN @@ -405,7 +405,7 @@ private Q_SLOTS: // GIVEN const int positionCount = 10; - QVector<QVector3D> positions(positionCount); + QList<QVector3D> positions(positionCount); for (int i = 0; i < positionCount; ++i) { const QVector3D p(float(i), 10.0f * i, 100.0f * i); positions[i] = p; diff --git a/tests/auto/render/updateshaderdatatransformjob/tst_updateshaderdatatransformjob.cpp b/tests/auto/render/updateshaderdatatransformjob/tst_updateshaderdatatransformjob.cpp index e12c74073..1283a91aa 100644 --- a/tests/auto/render/updateshaderdatatransformjob/tst_updateshaderdatatransformjob.cpp +++ b/tests/auto/render/updateshaderdatatransformjob/tst_updateshaderdatatransformjob.cpp @@ -44,11 +44,11 @@ QT_BEGIN_NAMESPACE namespace Qt3DRender { -QVector<Qt3DCore::QNode *> getNodesForCreation(Qt3DCore::QNode *root) +QList<Qt3DCore::QNode *> getNodesForCreation(Qt3DCore::QNode *root) { using namespace Qt3DCore; - QVector<QNode *> nodes; + QList<QNode *> nodes; Qt3DCore::QNodeVisitor visitor; visitor.traverse(root, [&nodes](QNode *node) { nodes.append(node); @@ -68,9 +68,9 @@ QVector<Qt3DCore::QNode *> getNodesForCreation(Qt3DCore::QNode *root) return nodes; } -QVector<Qt3DCore::NodeTreeChange> nodeTreeChangesForNodes(const QVector<Qt3DCore::QNode *> nodes) +QList<Qt3DCore::NodeTreeChange> nodeTreeChangesForNodes(const QList<Qt3DCore::QNode *> nodes) { - QVector<Qt3DCore::NodeTreeChange> nodeTreeChanges; + QList<Qt3DCore::NodeTreeChange> nodeTreeChanges; nodeTreeChanges.reserve(nodes.size()); for (Qt3DCore::QNode *n : nodes) { @@ -94,7 +94,7 @@ public: { Qt3DRender::QRenderAspect::onRegistered(); - const QVector<Qt3DCore::QNode *> nodes = getNodesForCreation(root); + const QList<Qt3DCore::QNode *> nodes = getNodesForCreation(root); d_func()->setRootAndCreateNodes(qobject_cast<Qt3DCore::QEntity *>(root), nodeTreeChangesForNodes(nodes)); Qt3DRender::Render::Entity *rootEntity = nodeManagers()->lookupResource<Qt3DRender::Render::Entity, Render::EntityManager>(rootEntityId()); @@ -149,7 +149,7 @@ struct NodeCollection } QList<Qt3DRender::QShaderData *> shaderData; - QVector<Qt3DRender::Render::ShaderData *> backendShaderData; + QList<Qt3DRender::Render::ShaderData *> backendShaderData; }; } // anonymous diff --git a/tests/benchmarks/core/qresourcesmanager/arraypolicy/tst_bench_arraypolicy.cpp b/tests/benchmarks/core/qresourcesmanager/arraypolicy/tst_bench_arraypolicy.cpp index 870a256c9..d0b105bb9 100644 --- a/tests/benchmarks/core/qresourcesmanager/arraypolicy/tst_bench_arraypolicy.cpp +++ b/tests/benchmarks/core/qresourcesmanager/arraypolicy/tst_bench_arraypolicy.cpp @@ -69,7 +69,7 @@ void benchmarkReleaseResources() Qt3DCore::ArrayAllocatingPolicy<T> allocator; const int max = (1 << 16) - 1; - QVector<Qt3DCore::QHandle<T>> resources(max); + QList<Qt3DCore::QHandle<T>> resources(max); for (int i = 0; i < max; i++) { resources[i] = allocator.allocateResource(); } diff --git a/tests/benchmarks/core/qresourcesmanager/qresourcesmanager/tst_bench_qresourcesmanager.cpp b/tests/benchmarks/core/qresourcesmanager/qresourcesmanager/tst_bench_qresourcesmanager.cpp index 10deecd12..6d41bdce0 100644 --- a/tests/benchmarks/core/qresourcesmanager/qresourcesmanager/tst_bench_qresourcesmanager.cpp +++ b/tests/benchmarks/core/qresourcesmanager/qresourcesmanager/tst_bench_qresourcesmanager.cpp @@ -86,7 +86,7 @@ void benchmarkAccessResources() { Qt3DCore::QResourceManager<Resource, int> manager; const int max = (1 << 16) - 1; - QVector<Qt3DCore::QHandle<Resource> > handles(max); + QList<Qt3DCore::QHandle<Resource> > handles(max); for (int i = 0; i < max; i++) handles[i] = manager.acquire(); @@ -102,7 +102,7 @@ template<typename Resource> void benchmarkRandomAccessResource() { Qt3DCore::QResourceManager<Resource, int> manager; const int max = (1 << 16) - 1; - QVector<Qt3DCore::QHandle<Resource> > handles(max); + QList<Qt3DCore::QHandle<Resource> > handles(max); for (int i = 0; i < max; i++) handles[i] = manager.acquire(); @@ -139,7 +139,7 @@ void benchmarkRandomLookupResources() { Qt3DCore::QResourceManager<Resource, int> manager; const int max = (1 << 16) - 1; - QVector<int> resourcesIndices(max); + QList<int> resourcesIndices(max); for (int i = 0; i < max; i++) { manager.getOrCreateResource(i); resourcesIndices[i] = i; @@ -162,7 +162,7 @@ void benchmarkReleaseResources() { Qt3DCore::QResourceManager<Resource, int> manager; const int max = (1 << 16) - 1; - QVector<Qt3DCore::QHandle<Resource> > handles(max); + QList<Qt3DCore::QHandle<Resource> > handles(max); for (int i = 0; i < max; i++) handles[i] = manager.acquire(); for (int i = 0; i < max; i++) diff --git a/tests/benchmarks/render/jobs/tst_bench_jobs.cpp b/tests/benchmarks/render/jobs/tst_bench_jobs.cpp index a8e43bd00..ae6add27c 100644 --- a/tests/benchmarks/render/jobs/tst_bench_jobs.cpp +++ b/tests/benchmarks/render/jobs/tst_bench_jobs.cpp @@ -130,7 +130,7 @@ namespace Qt3DRender { void onRootEntityChanged(Qt3DCore::QEntity *root) { if (!m_window) { - QVector<Qt3DCore::NodeTreeChange> nodes; + QList<Qt3DCore::NodeTreeChange> nodes; Qt3DCore::QNodeVisitor v; v.traverse(root, [&nodes](Qt3DCore::QNode *node) { Qt3DCore::QNodePrivate *d = Qt3DCore::QNodePrivate::get(node); @@ -385,7 +385,7 @@ private Q_SLOTS: qDebug() << 2; // WHEN - QVector<Qt3DCore::QAspectJobPtr> jobs = aspect.renderBinJobs(); + QList<Qt3DCore::QAspectJobPtr> jobs = aspect.renderBinJobs(); qDebug() << 3; QBENCHMARK { qDebug() << 4; diff --git a/tests/benchmarks/render/layerfiltering/tst_bench_layerfiltering.cpp b/tests/benchmarks/render/layerfiltering/tst_bench_layerfiltering.cpp index a3b4213b5..4c5751855 100644 --- a/tests/benchmarks/render/layerfiltering/tst_bench_layerfiltering.cpp +++ b/tests/benchmarks/render/layerfiltering/tst_bench_layerfiltering.cpp @@ -55,7 +55,7 @@ public: Qt3DCore::QAbstractAspectPrivate::get(this)->m_jobManager = m_jobManager.data(); QRenderAspect::onRegistered(); - QVector<Qt3DCore::NodeTreeChange> nodes; + QList<Qt3DCore::NodeTreeChange> nodes; Qt3DCore::QNodeVisitor v; v.traverse(root, [&nodes](Qt3DCore::QNode *node) { Qt3DCore::QNodePrivate *d = Qt3DCore::QNodePrivate::get(node); @@ -98,17 +98,16 @@ namespace { Qt3DCore::QEntity *buildTestScene(int layersCount, int entityCount, - QVector<Qt3DCore::QNodeId> &layerFilterIds, + QList<Qt3DCore::QNodeId> &layerFilterIds, bool alwaysEnabled = true) { Qt3DCore::QEntity *root = new Qt3DCore::QEntity(); Qt3DRender::QLayerFilter *layerFilter = new Qt3DRender::QLayerFilter(root); layerFilterIds.push_back(layerFilter->id()); - QVector<Qt3DRender::QLayer *> layers; + QList<Qt3DRender::QLayer *> layers; layers.reserve(layersCount); - for (int i = 0; i < layersCount; ++i) { Qt3DRender::QLayer *layer = new Qt3DRender::QLayer(root); layers.push_back(layer); diff --git a/tests/benchmarks/render/materialparametergathering/tst_bench_materialparametergathering.cpp b/tests/benchmarks/render/materialparametergathering/tst_bench_materialparametergathering.cpp index a1b7f740a..d44c5bf1a 100644 --- a/tests/benchmarks/render/materialparametergathering/tst_bench_materialparametergathering.cpp +++ b/tests/benchmarks/render/materialparametergathering/tst_bench_materialparametergathering.cpp @@ -56,7 +56,7 @@ public: Qt3DCore::QAbstractAspectPrivate::get(this)->m_jobManager = m_jobManager.data(); QRenderAspect::onRegistered(); - QVector<Qt3DCore::NodeTreeChange> nodes; + QList<Qt3DCore::NodeTreeChange> nodes; Qt3DCore::QNodeVisitor v; v.traverse(root, [&nodes](Qt3DCore::QNode *node) { Qt3DCore::QNodePrivate *d = Qt3DCore::QNodePrivate::get(node); diff --git a/tests/benchmarks/render/opengl/shaderparameterpack/tst_bench_shaderparameterpack.cpp b/tests/benchmarks/render/opengl/shaderparameterpack/tst_bench_shaderparameterpack.cpp index c7c3ea72c..16ecfc99e 100644 --- a/tests/benchmarks/render/opengl/shaderparameterpack/tst_bench_shaderparameterpack.cpp +++ b/tests/benchmarks/render/opengl/shaderparameterpack/tst_bench_shaderparameterpack.cpp @@ -47,7 +47,7 @@ private Q_SLOTS: // GIVEN PackUniformHash pack; - QVector<int> randKeys(64); + QList<int> randKeys(64); QRandomGenerator gen; for (int i = 0; i < 64; ++i) diff --git a/tests/manual/assimp-cpp/main.cpp b/tests/manual/assimp-cpp/main.cpp index 06e0907be..af18874da 100644 --- a/tests/manual/assimp-cpp/main.cpp +++ b/tests/manual/assimp-cpp/main.cpp @@ -82,7 +82,7 @@ void SceneWalker::onStatusChanged() // The QSceneLoader instance is a component of an entity. The loaded scene // tree is added under this entity. - QVector<Qt3DCore::QEntity *> entities = m_loader->entities(); + QList<Qt3DCore::QEntity *> entities = m_loader->entities(); // Technically there could be multiple entities referencing the scene loader // but sharing is discouraged, and in our case there will be one anyhow. diff --git a/tests/manual/assimp/main.cpp b/tests/manual/assimp/main.cpp index 307ff87c2..a57fce093 100644 --- a/tests/manual/assimp/main.cpp +++ b/tests/manual/assimp/main.cpp @@ -69,7 +69,7 @@ QObject *SceneHelper::findEntity(Qt3DRender::QSceneLoader *loader, const QString { // The QSceneLoader instance is a component of an entity. The loaded scene // tree is added under this entity. - QVector<Qt3DCore::QEntity *> entities = loader->entities(); + QList<Qt3DCore::QEntity *> entities = loader->entities(); if (entities.isEmpty()) return 0; diff --git a/tests/manual/custom-mesh-cpp-indirect/main.cpp b/tests/manual/custom-mesh-cpp-indirect/main.cpp index 0cb19f8b2..87ca2b2dc 100644 --- a/tests/manual/custom-mesh-cpp-indirect/main.cpp +++ b/tests/manual/custom-mesh-cpp-indirect/main.cpp @@ -149,11 +149,10 @@ int main(int argc, char* argv[]) QVector3D blue(0.0f, 0.0f, 1.0f); QVector3D white(1.0f, 1.0f, 1.0f); - const QVector<QVector3D> vertices = QVector<QVector3D>() - << v0 << n0 << red - << v1 << n1 << blue - << v2 << n2 << green - << v3 << n3 << white; + const QList<QVector3D> vertices = { v0, n0, red, + v1, n1, blue, + v2, n2, green, + v3, n3, white }; // DrawElementIndirect { @@ -304,7 +303,7 @@ int main(int argc, char* argv[]) Qt3DCore::QBuffer *indirectDrawDataBuffer = new Qt3DCore::QBuffer(customGeometry); - QVector<QVector3D> orderedPositionVertices; + QList<QVector3D> orderedPositionVertices; // 12 vertices with position, normal, color orderedPositionVertices.reserve(12 * (1 + 1 + 1)); diff --git a/tests/manual/custom-mesh-cpp/main.cpp b/tests/manual/custom-mesh-cpp/main.cpp index dee8363d8..de54d3994 100644 --- a/tests/manual/custom-mesh-cpp/main.cpp +++ b/tests/manual/custom-mesh-cpp/main.cpp @@ -149,11 +149,10 @@ int main(int argc, char* argv[]) QVector3D blue(0.0f, 0.0f, 1.0f); QVector3D white(1.0f, 1.0f, 1.0f); - const QVector<QVector3D> vertices = QVector<QVector3D>() - << v0 << n0 << red - << v1 << n1 << blue - << v2 << n2 << green - << v3 << n3 << white; + const QList<QVector3D> vertices = { v0, n0, red, + v1, n1, blue, + v2, n2, green, + v3, n3, white }; float *rawVertexArray = reinterpret_cast<float *>(vertexBufferData.data()); int idx = 0; diff --git a/tests/manual/custom-mesh-update-data-cpp/main.cpp b/tests/manual/custom-mesh-update-data-cpp/main.cpp index 9f997658b..65b36e5c4 100644 --- a/tests/manual/custom-mesh-update-data-cpp/main.cpp +++ b/tests/manual/custom-mesh-update-data-cpp/main.cpp @@ -167,11 +167,10 @@ int main(int argc, char* argv[]) QVector3D blue(0.0f, 0.0f, 1.0f); QVector3D white(1.0f, 1.0f, 1.0f); - const QVector<QVector3D> vertices = QVector<QVector3D>() - << v0 << n0 << red - << v1 << n1 << blue - << v2 << n2 << green - << v3 << n3 << white; + const QList<QVector3D> vertices = { v0, n0, red, + v1, n1, blue, + v2, n2, green, + v3, n3, white }; float *rawVertexArray = reinterpret_cast<float *>(vertexBufferData.data()); int idx = 0; @@ -284,7 +283,7 @@ void TimerObject::timeout() QVector3D c2(qFabs(qSin(angle)), qFabs(qCos(angle + M_PI_4)), qFabs(qSin(angle + M_PI_4))); QVector3D c3(qFabs(qSin(angle + M_PI_4)), qFabs(qSin(angle)), qFabs(qCos(angle))); - const QVector<QVector3D> colors = QVector<QVector3D>() << c1 << c2 << c3; + const QList<QVector3D> colors = { c1, c2, c3 }; float *rawVertexArray = reinterpret_cast<float *>(updateData.data()); diff --git a/tests/manual/deferred-renderer-cpp/finaleffect.cpp b/tests/manual/deferred-renderer-cpp/finaleffect.cpp index ac8dc684b..f252f14b2 100644 --- a/tests/manual/deferred-renderer-cpp/finaleffect.cpp +++ b/tests/manual/deferred-renderer-cpp/finaleffect.cpp @@ -99,7 +99,7 @@ FinalEffect::FinalEffect(Qt3DCore::QNode *parent) QList<Qt3DRender::QFilterKey *> FinalEffect::passCriteria() const { - return QList<Qt3DRender::QFilterKey *>() << m_passCriterion; + return { m_passCriterion }; } QT_END_NAMESPACE diff --git a/tests/manual/deferred-renderer-cpp/sceneeffect.cpp b/tests/manual/deferred-renderer-cpp/sceneeffect.cpp index 570df66c7..2d323944b 100644 --- a/tests/manual/deferred-renderer-cpp/sceneeffect.cpp +++ b/tests/manual/deferred-renderer-cpp/sceneeffect.cpp @@ -101,7 +101,7 @@ SceneEffect::SceneEffect(Qt3DCore::QNode *parent) QList<Qt3DRender::QFilterKey *> SceneEffect::passCriteria() const { - return QList<Qt3DRender::QFilterKey *>() << m_passCriterion; + return { m_passCriterion }; } QT_END_NAMESPACE diff --git a/tests/manual/mesh-morphing/main.cpp b/tests/manual/mesh-morphing/main.cpp index 5534943da..79f6eee60 100644 --- a/tests/manual/mesh-morphing/main.cpp +++ b/tests/manual/mesh-morphing/main.cpp @@ -111,18 +111,14 @@ int main(int argc, char **argv) attributes.push_back(Qt3DCore::QAttribute::defaultPositionAttributeName()); attributes.push_back(Qt3DCore::QAttribute::defaultNormalAttributeName()); - QVector<Qt3DAnimation::QMorphTarget*> morphTargets; - morphTargets.push_back(Qt3DAnimation::QMorphTarget::fromGeometry(cylinder1, attributes)); - morphTargets.push_back(Qt3DAnimation::QMorphTarget::fromGeometry(cylinder2, attributes)); - morphTargets.push_back(Qt3DAnimation::QMorphTarget::fromGeometry(cylinder3, attributes)); - morphTargets.push_back(morphTargets.first()); + const QList<Qt3DAnimation::QMorphTarget*> morphTargets + = { Qt3DAnimation::QMorphTarget::fromGeometry(cylinder1, attributes), + Qt3DAnimation::QMorphTarget::fromGeometry(cylinder2, attributes), + Qt3DAnimation::QMorphTarget::fromGeometry(cylinder3, attributes), + Qt3DAnimation::QMorphTarget::fromGeometry(cylinder1, attributes) }; Qt3DAnimation::QVertexBlendAnimation *animation = new Qt3DAnimation::QVertexBlendAnimation; - QVector<float> times; - times.push_back(0.0f); - times.push_back(5.0f); - times.push_back(8.0f); - times.push_back(12.0f); + const QList<float> times = { 0.0f, 5.0f, 8.0f, 12.0f }; auto renderer = new Qt3DRender::QGeometryRenderer; renderer->setView(mesh); diff --git a/tests/manual/rhi/main.cpp b/tests/manual/rhi/main.cpp index 9c86110ba..bca544a20 100644 --- a/tests/manual/rhi/main.cpp +++ b/tests/manual/rhi/main.cpp @@ -356,12 +356,11 @@ int main(int argc, char* argv[]) QVector3D white(1.0f, 1.0f, 1.0f); QVector3D grey(0.5f, 0.5f, 0.5f); - const QVector<QVector3D> vertices = QVector<QVector3D>() - << v0 << red - << v1 << green - << v2 << blue - << v3 << grey - << v4 << white; + const QList<QVector3D> vertices = { v0, red, + v1, green, + v2, blue, + v3, grey, + v4, white }; memcpy(vertexBufferData.data(), vertices.constData(), vertices.size() * sizeof(QVector3D)); vertexDataBuffer->setData(vertexBufferData); |