diff options
author | Mike Krus <mike.krus@kdab.com> | 2020-11-20 16:47:37 +0000 |
---|---|---|
committer | Mike Krus <mike.krus@kdab.com> | 2021-01-05 13:57:54 +0000 |
commit | 173be1a93699c54d9680d809ca5a56ce0ccccd9a (patch) | |
tree | bf773d21f61edbc522e8b4128d40f2cb5458a0c2 /tests | |
parent | 45dfb8a03f4ee2abb963ce3726eaef0dd1c2c521 (diff) |
Restore use of QVector in private API
Facilitates building against Qt 5.15.
Will migrate to std::vector over time.
Change-Id: I5db14c9ea95b38e4b2d596d7397fef76f6baf118
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Diffstat (limited to 'tests')
17 files changed, 218 insertions, 218 deletions
diff --git a/tests/auto/animation/animationutils/tst_animationutils.cpp b/tests/auto/animation/animationutils/tst_animationutils.cpp index d08183976..793d3bbe9 100644 --- a/tests/auto/animation/animationutils/tst_animationutils.cpp +++ b/tests/auto/animation/animationutils/tst_animationutils.cpp @@ -51,18 +51,18 @@ using namespace Qt3DAnimation::Animation; Q_DECLARE_METATYPE(Qt3DAnimation::Animation::Handler*) -Q_DECLARE_METATYPE(QList<ChannelMapping *>) +Q_DECLARE_METATYPE(QVector<ChannelMapping *>) Q_DECLARE_METATYPE(Clock *) Q_DECLARE_METATYPE(ChannelMapper *) Q_DECLARE_METATYPE(AnimationClip *) -Q_DECLARE_METATYPE(QList<MappingData>) +Q_DECLARE_METATYPE(QVector<MappingData>) Q_DECLARE_METATYPE(Channel) Q_DECLARE_METATYPE(AnimatorEvaluationData) Q_DECLARE_METATYPE(ClipEvaluationData) Q_DECLARE_METATYPE(ClipAnimator *) Q_DECLARE_METATYPE(BlendedClipAnimator *) -Q_DECLARE_METATYPE(QList<ChannelNameAndType>) -Q_DECLARE_METATYPE(QList<AnimationCallbackAndValue>) +Q_DECLARE_METATYPE(QVector<ChannelNameAndType>) +Q_DECLARE_METATYPE(QVector<AnimationCallbackAndValue>) Q_DECLARE_METATYPE(ClipFormat) Q_DECLARE_METATYPE(ChannelNameAndType) @@ -275,11 +275,11 @@ private Q_SLOTS: void checkBuildPropertyMappings_data() { QTest::addColumn<Handler *>("handler"); - QTest::addColumn<QList<ChannelMapping *>>("channelMappings"); - QTest::addColumn<QList<ChannelNameAndType>>("channelNamesAndTypes"); - QTest::addColumn<QList<ComponentIndices>>("channelComponentIndices"); - QTest::addColumn<QList<QBitArray>>("sourceClipMask"); - QTest::addColumn<QList<MappingData>>("expectedResults"); + QTest::addColumn<QVector<ChannelMapping *>>("channelMappings"); + QTest::addColumn<QVector<ChannelNameAndType>>("channelNamesAndTypes"); + QTest::addColumn<QVector<ComponentIndices>>("channelComponentIndices"); + QTest::addColumn<QVector<QBitArray>>("sourceClipMask"); + QTest::addColumn<QVector<MappingData>>("expectedResults"); // Single ChannelMapping { @@ -292,7 +292,7 @@ private Q_SLOTS: static_cast<int>(QMetaType::QVector3D), 3); - const QList<ChannelMapping *> channelMappings = { channelMapping }; + const QVector<ChannelMapping *> channelMappings = { channelMapping }; // Create a few channels in the format description const ChannelNameAndType rotation = { QLatin1String("Rotation"), @@ -320,7 +320,7 @@ private Q_SLOTS: 5, channelMapping->peerId() }; const ChannelNameAndType morphTargetWeightsVec = { QLatin1String("MorphTargetWeightsVec"), - qMetaTypeId<QList<float>>(), + qMetaTypeId<QVector<float>>(), 6, channelMapping->peerId() }; const ChannelNameAndType rgbColor = { QLatin1String("rgbColor"), @@ -332,7 +332,7 @@ private Q_SLOTS: 4, channelMapping->peerId() }; - const QList<ChannelNameAndType> channelNamesAndTypes + const QVector<ChannelNameAndType> channelNamesAndTypes = { rotation, location, baseColor, metalness, roughness, morphTargetWeightsList, morphTargetWeightsVec, rgbColor, rgbaColor }; @@ -346,27 +346,27 @@ private Q_SLOTS: const ComponentIndices morphTargetVecIndices = { 17, 18, 19, 20, 21, 22 }; const ComponentIndices rgbColorIndices = { 23, 24, 25 }; const ComponentIndices rgbaColorIndices = { 26, 27, 28, 29 }; - const QList<ComponentIndices> channelComponentIndices + const QVector<ComponentIndices> channelComponentIndices = { rotationIndices, locationIndices, baseColorIndices, metalnessIndices, roughnessIndices, morphTargetListIndices, morphTargetVecIndices, rgbColorIndices, rgbaColorIndices }; - const QList<QBitArray> sourceClipMask = { QBitArray(4, true), - QBitArray(3, true), - QBitArray(3, true), - QBitArray(1, true), - QBitArray(1, true), - QBitArray(5, true), - QBitArray(6, true), - QBitArray(3, true), - QBitArray(4, true) }; + const QVector<QBitArray> sourceClipMask = { QBitArray(4, true), + QBitArray(3, true), + QBitArray(3, true), + QBitArray(1, true), + QBitArray(1, true), + QBitArray(5, true), + QBitArray(6, true), + QBitArray(3, true), + QBitArray(4, true) }; MappingData expectedMapping; expectedMapping.targetId = channelMapping->targetId(); expectedMapping.propertyName = channelMapping->propertyName(); expectedMapping.type = channelMapping->type(); expectedMapping.channelIndices = locationIndices; - const QList<MappingData> expectedResults = { expectedMapping }; + const QVector<MappingData> expectedResults = { expectedMapping }; QTest::newRow("single mapping") << handler @@ -424,7 +424,7 @@ private Q_SLOTS: 5); - const QList<ChannelMapping *> channelMappings + const QVector<ChannelMapping *> channelMappings = { locationMapping, metalnessMapping, baseColorMapping, roughnessMapping, rotationMapping, morphTargetMapping }; @@ -454,7 +454,7 @@ private Q_SLOTS: static_cast<int>(QMetaType::QVariantList), 5, morphTargetMapping->peerId() }; - const QList<ChannelNameAndType> channelNamesAndTypes + const QVector<ChannelNameAndType> channelNamesAndTypes = { rotation, location, baseColor, metalness, roughness, morphTarget }; @@ -465,16 +465,16 @@ private Q_SLOTS: const ComponentIndices metalnessIndices = { 10 }; const ComponentIndices roughnessIndices = { 11 }; const ComponentIndices morphTargetIndices = { 12, 13, 14, 15, 16 }; - const QList<ComponentIndices> channelComponentIndices + const QVector<ComponentIndices> channelComponentIndices = { rotationIndices, locationIndices, baseColorIndices, metalnessIndices, roughnessIndices, morphTargetIndices }; - const QList<QBitArray> sourceClipMask = { QBitArray(4, true), - QBitArray(3, true), - QBitArray(3, true), - QBitArray(1, true), - QBitArray(1, true), - QBitArray(5, true) }; + const QVector<QBitArray> sourceClipMask = { QBitArray(4, true), + QBitArray(3, true), + QBitArray(3, true), + QBitArray(1, true), + QBitArray(1, true), + QBitArray(5, true) }; MappingData expectedLocationMapping; expectedLocationMapping.targetId = locationMapping->targetId(); @@ -512,7 +512,7 @@ private Q_SLOTS: expectedMorphTargetMapping.type = morphTargetMapping->type(); expectedMorphTargetMapping.channelIndices = morphTargetIndices; - const QList<MappingData> expectedResults + const QVector<MappingData> expectedResults = { expectedLocationMapping, expectedMetalnessMapping, expectedBaseColorMapping, @@ -536,10 +536,10 @@ private Q_SLOTS: auto skeleton = createSkeleton(handler, jointCount); auto channelMapping = createChannelMapping(handler, skeleton->peerId()); - const QList<ChannelMapping *> channelMappings = { channelMapping }; + const QVector<ChannelMapping *> channelMappings = { channelMapping }; // Create a few channels in the format description - QList<ChannelNameAndType> channelNamesAndTypes; + QVector<ChannelNameAndType> channelNamesAndTypes; for (int i = 0; i < jointCount; ++i) { ChannelNameAndType locationDescription = { QLatin1String("Location"), static_cast<int>(QMetaType::QVector3D), @@ -567,27 +567,27 @@ private Q_SLOTS: } // And the matching indices - const QList<ComponentIndices> channelComponentIndices = { + const QVector<ComponentIndices> channelComponentIndices = { { 0, 1, 2 }, { 3, 4, 5, 6 }, { 7, 8, 9 }, { 10, 11, 12 }, { 13, 14, 15, 16 }, { 17, 18, 19 }, { 20, 21, 22 }, { 23, 24, 25, 26 }, { 27, 28, 29 }, { 30, 31, 32 }, { 33, 34, 35, 36 }, { 37, 38, 39 } }; - const QList<QBitArray> sourceClipMask = { QBitArray(3, true), - QBitArray(4, true), - QBitArray(3, true), - QBitArray(3, true), - QBitArray(4, true), - QBitArray(3, true), - QBitArray(3, true), - QBitArray(4, true), - QBitArray(3, true), - QBitArray(3, true), - QBitArray(4, true), - QBitArray(3, true) }; - - QList<MappingData> expectedResults; + const QVector<QBitArray> sourceClipMask = { QBitArray(3, true), + QBitArray(4, true), + QBitArray(3, true), + QBitArray(3, true), + QBitArray(4, true), + QBitArray(3, true), + QBitArray(3, true), + QBitArray(4, true), + QBitArray(3, true), + QBitArray(3, true), + QBitArray(4, true), + QBitArray(3, true) }; + + QVector<MappingData> expectedResults; int componentIndicesIndex = 0; for (int i = 0; i < jointCount; ++i) { MappingData locationMapping; @@ -628,17 +628,17 @@ private Q_SLOTS: { // GIVEN QFETCH(Handler *, handler); - QFETCH(QList<ChannelMapping *>, channelMappings); - QFETCH(QList<ChannelNameAndType>, channelNamesAndTypes); - QFETCH(QList<ComponentIndices>, channelComponentIndices); - QFETCH(QList<QBitArray>, sourceClipMask); - QFETCH(QList<MappingData>, expectedResults); + QFETCH(QVector<ChannelMapping *>, channelMappings); + QFETCH(QVector<ChannelNameAndType>, channelNamesAndTypes); + QFETCH(QVector<ComponentIndices>, channelComponentIndices); + QFETCH(QVector<QBitArray>, sourceClipMask); + QFETCH(QVector<MappingData>, expectedResults); // WHEN - const QList<MappingData> actualResults = buildPropertyMappings(channelMappings, - channelNamesAndTypes, - channelComponentIndices, - sourceClipMask); + const auto actualResults = buildPropertyMappings(channelMappings, + channelNamesAndTypes, + channelComponentIndices, + sourceClipMask); // THEN QCOMPARE(actualResults.size(), expectedResults.size()); @@ -794,13 +794,13 @@ private Q_SLOTS: void checkPreparePropertyChanges_data() { QTest::addColumn<Qt3DCore::QNodeId>("animatorId"); - QTest::addColumn<QList<MappingData>>("mappingData"); - QTest::addColumn<QList<float>>("channelResults"); + QTest::addColumn<QVector<MappingData>>("mappingData"); + QTest::addColumn<QVector<float>>("channelResults"); QTest::addColumn<AnimationRecord>("expectedChanges"); Qt3DCore::QNodeId animatorId; - QList<MappingData> mappingData; - QList<float> channelResults; + QVector<MappingData> mappingData; + QVector<float> channelResults; AnimationRecord expectedChanges; // Single property, vec3 @@ -810,9 +810,9 @@ private Q_SLOTS: mapping.targetId = Qt3DCore::QNodeId::createId(); mapping.propertyName = "translation"; mapping.type = static_cast<int>(QMetaType::QVector3D); - mapping.channelIndices = QList<int> { 0, 1, 2 }; + mapping.channelIndices = QVector<int> { 0, 1, 2 }; mappingData.push_back(mapping); - channelResults = QList<float> { 1.0f, 2.0f, 3.0f }; + channelResults = QVector<float> { 1.0f, 2.0f, 3.0f }; expectedChanges.normalizedTime = 1.1f; // Invalid expectedChanges.finalFrame = false; expectedChanges.targetChanges.push_back({mapping.targetId, mapping.propertyName, QVariant::fromValue(QVector3D(1.0f, 2.0f, 3.0f))}); @@ -838,17 +838,17 @@ private Q_SLOTS: translationMapping.targetId = Qt3DCore::QNodeId::createId(); translationMapping.propertyName = "translation"; translationMapping.type = static_cast<int>(QMetaType::QVector3D); - translationMapping.channelIndices = QList<int> { 0, 1, 2 }; + translationMapping.channelIndices = QVector<int> { 0, 1, 2 }; mappingData.push_back(translationMapping); MappingData scaleMapping; scaleMapping.targetId = Qt3DCore::QNodeId::createId(); scaleMapping.propertyName = "scale"; scaleMapping.type = static_cast<int>(QMetaType::QVector3D); - scaleMapping.channelIndices = QList<int> { 3, 4, 5 }; + scaleMapping.channelIndices = QVector<int> { 3, 4, 5 }; mappingData.push_back(scaleMapping); - channelResults = QList<float> { 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f }; + channelResults = QVector<float> { 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f }; expectedChanges.finalFrame = false; expectedChanges.normalizedTime = -0.1f; // Invalid @@ -876,9 +876,9 @@ private Q_SLOTS: mapping.targetId = Qt3DCore::QNodeId::createId(); mapping.propertyName = "mass"; mapping.type = static_cast<int>(QMetaType::Double); - mapping.channelIndices = QList<int> { 0 }; + mapping.channelIndices = QVector<int> { 0 }; mappingData.push_back(mapping); - channelResults = QList<float> { 3.5f }; + channelResults = QVector<float> { 3.5f }; expectedChanges.finalFrame = false; expectedChanges.normalizedTime = -1.0f; // Invalid expectedChanges.targetChanges.push_back({mapping.targetId, mapping.propertyName, QVariant::fromValue(3.5f)}); @@ -898,9 +898,9 @@ private Q_SLOTS: mapping.targetId = Qt3DCore::QNodeId::createId(); mapping.propertyName = "pos"; mapping.type = static_cast<int>(QMetaType::QVector2D); - mapping.channelIndices = QList<int> { 0, 1 }; + mapping.channelIndices = QVector<int> { 0, 1 }; mappingData.push_back(mapping); - channelResults = QList<float> { 2.0f, 1.0f }; + channelResults = QVector<float> { 2.0f, 1.0f }; expectedChanges.finalFrame = false; expectedChanges.normalizedTime = 1.1f; // Invalid expectedChanges.targetChanges.push_back({mapping.targetId, mapping.propertyName, QVariant::fromValue(QVector2D(2.0f, 1.0f))}); @@ -920,9 +920,9 @@ private Q_SLOTS: mapping.targetId = Qt3DCore::QNodeId::createId(); mapping.propertyName = "foo"; mapping.type = static_cast<int>(QMetaType::QVector4D); - mapping.channelIndices = QList<int> { 0, 1, 2, 3 }; + mapping.channelIndices = QVector<int> { 0, 1, 2, 3 }; mappingData.push_back(mapping); - channelResults = QList<float> { 4.0f, 3.0f, 2.0f, 1.0f }; + channelResults = QVector<float> { 4.0f, 3.0f, 2.0f, 1.0f }; expectedChanges.finalFrame = false; expectedChanges.normalizedTime = 1.1f; // Invalid expectedChanges.targetChanges.push_back({mapping.targetId, mapping.propertyName, QVariant::fromValue(QVector4D(4.0f, 3.0f, 2.0f, 1.0f))}); @@ -942,9 +942,9 @@ private Q_SLOTS: mapping.targetId = Qt3DCore::QNodeId::createId(); mapping.propertyName = "rotation"; mapping.type = static_cast<int>(QMetaType::QQuaternion); - mapping.channelIndices = QList<int> { 0, 1, 2, 3 }; + mapping.channelIndices = QVector<int> { 0, 1, 2, 3 }; mappingData.push_back(mapping); - channelResults = QList<float> { 1.0f, 0.0f, 0.0f, 1.0f }; + channelResults = QVector<float> { 1.0f, 0.0f, 0.0f, 1.0f }; expectedChanges.finalFrame = false; expectedChanges.normalizedTime = -0.1f; // Invalid expectedChanges.targetChanges.push_back({mapping.targetId, mapping.propertyName, QVariant::fromValue(QQuaternion(1.0f, 0.0f, 0.0f, 1.0f).normalized())}); @@ -964,9 +964,9 @@ private Q_SLOTS: mapping.targetId = Qt3DCore::QNodeId::createId(); mapping.propertyName = "color"; mapping.type = static_cast<int>(QMetaType::QColor); - mapping.channelIndices = QList<int> { 0, 1, 2 }; + mapping.channelIndices = QVector<int> { 0, 1, 2 }; mappingData.push_back(mapping); - channelResults = QList<float> { 0.5f, 0.4f, 0.3f }; + channelResults = QVector<float> { 0.5f, 0.4f, 0.3f }; expectedChanges.finalFrame = false; expectedChanges.normalizedTime = 1.1f; // Invalid expectedChanges.targetChanges.push_back({mapping.targetId, mapping.propertyName, QVariant::fromValue(QColor::fromRgbF(0.5f, 0.4f, 0.3f))}); @@ -986,9 +986,9 @@ private Q_SLOTS: mapping.targetId = Qt3DCore::QNodeId::createId(); mapping.propertyName = "color"; mapping.type = static_cast<int>(QMetaType::QColor); - mapping.channelIndices = QList<int> { 0, 1, 2, 3 }; + mapping.channelIndices = QVector<int> { 0, 1, 2, 3 }; mappingData.push_back(mapping); - channelResults = QList<float> { 0.5f, 0.4f, 0.3f, 0.2f }; + channelResults = QVector<float> { 0.5f, 0.4f, 0.3f, 0.2f }; expectedChanges.finalFrame = false; expectedChanges.normalizedTime = 1.1f; // Invalid expectedChanges.targetChanges.push_back({mapping.targetId, mapping.propertyName, QVariant::fromValue(QColor::fromRgbF(0.5f, 0.4f, 0.3f, 0.2f))}); @@ -1008,9 +1008,9 @@ private Q_SLOTS: mapping.targetId = Qt3DCore::QNodeId::createId(); mapping.propertyName = "weights"; mapping.type = static_cast<int>(QMetaType::QVariantList); - mapping.channelIndices = QList<int> { 0, 1, 2, 3, 4, 5, 6 }; + mapping.channelIndices = QVector<int> { 0, 1, 2, 3, 4, 5, 6 }; mappingData.push_back(mapping); - channelResults = QList<float> { 0.5f, 0.4f, 0.3f, 0.0f, 1.0f, 0.6f, 0.9f }; + channelResults = QVector<float> { 0.5f, 0.4f, 0.3f, 0.0f, 1.0f, 0.6f, 0.9f }; expectedChanges.finalFrame = false; expectedChanges.normalizedTime = 1.1f; // Invalid QVariantList expectedValue = QVariantList { 0.5f, 0.4f, 0.3f, 0.0f, 1.0f, 0.6f, 0.9f }; @@ -1030,8 +1030,8 @@ private Q_SLOTS: { // GIVEN QFETCH(Qt3DCore::QNodeId, animatorId); - QFETCH(QList<MappingData>, mappingData); - QFETCH(QList<float>, channelResults); + QFETCH(QVector<MappingData>, mappingData); + QFETCH(QVector<float>, channelResults); QFETCH(AnimationRecord, expectedChanges); // WHEN @@ -1052,13 +1052,13 @@ private Q_SLOTS: void checkPrepareCallbacks_data() { - QTest::addColumn<QList<MappingData>>("mappingData"); - QTest::addColumn<QList<float>>("channelResults"); - QTest::addColumn<QList<AnimationCallbackAndValue> >("expectedValues"); + QTest::addColumn<QVector<MappingData>>("mappingData"); + QTest::addColumn<QVector<float>>("channelResults"); + QTest::addColumn<QVector<AnimationCallbackAndValue> >("expectedValues"); - QList<MappingData> mappingData; - QList<float> channelResults; - QList<AnimationCallbackAndValue> expectedValues; + QVector<MappingData> mappingData; + QVector<float> channelResults; + QVector<AnimationCallbackAndValue> expectedValues; // vec3 { @@ -1067,11 +1067,11 @@ private Q_SLOTS: mapping.targetId = Qt3DCore::QNodeId::createId(); mapping.propertyName = "translation"; mapping.type = static_cast<int>(QMetaType::QVector3D); - mapping.channelIndices = QList<int> { 0, 1, 2 }; + mapping.channelIndices = QVector<int> { 0, 1, 2 }; mapping.callback = &callback; mapping.callbackFlags = {}; mappingData.push_back(mapping); - channelResults = QList<float> { 1.0f, 2.0f, 3.0f }; + channelResults = QVector<float> { 1.0f, 2.0f, 3.0f }; AnimationCallbackAndValue cbv; cbv.callback = mapping.callback; @@ -1093,11 +1093,11 @@ private Q_SLOTS: mapping.targetId = Qt3DCore::QNodeId::createId(); mapping.propertyName = "something"; mapping.type = static_cast<int>(QMetaType::Double); - mapping.channelIndices = QList<int> { 0 }; + mapping.channelIndices = QVector<int> { 0 }; mapping.callback = &callback; mapping.callbackFlags = {}; mappingData.push_back(mapping); - channelResults = QList<float> { 1.0f }; + channelResults = QVector<float> { 1.0f }; AnimationCallbackAndValue cbv; cbv.callback = mapping.callback; @@ -1119,11 +1119,11 @@ private Q_SLOTS: mapping.targetId = Qt3DCore::QNodeId::createId(); mapping.propertyName = "opacity"; mapping.type = static_cast<int>(QMetaType::Float); - mapping.channelIndices = QList<int> { 0 }; + mapping.channelIndices = QVector<int> { 0 }; mapping.callback = &callback; mapping.callbackFlags = Qt3DAnimation::QAnimationCallback::OnThreadPool; mappingData.push_back(mapping); - channelResults = QList<float> { 0.5f }; + channelResults = QVector<float> { 0.5f }; AnimationCallbackAndValue cbv; cbv.callback = mapping.callback; @@ -1142,12 +1142,12 @@ private Q_SLOTS: void checkPrepareCallbacks() { // GIVEN - QFETCH(QList<MappingData>, mappingData); - QFETCH(QList<float>, channelResults); - QFETCH(QList<AnimationCallbackAndValue>, expectedValues); + QFETCH(QVector<MappingData>, mappingData); + QFETCH(QVector<float>, channelResults); + QFETCH(QVector<AnimationCallbackAndValue>, expectedValues); // WHEN - QList<AnimationCallbackAndValue> callbacks = prepareCallbacks(mappingData, channelResults); + QVector<AnimationCallbackAndValue> callbacks = prepareCallbacks(mappingData, channelResults); // THEN QCOMPARE(callbacks.size(), expectedValues.size()); @@ -1177,7 +1177,7 @@ private Q_SLOTS: handler = new Handler(); clip = createAnimationClipLoader(handler, QUrl("qrc:/clip1.json")); localTime = 0.0f; - expectedResults = QList<float> { 0.0f, 0.0f, 0.0f }; + expectedResults = QVector<float> { 0.0f, 0.0f, 0.0f }; QTest::newRow("clip1.json, t = 0.0") << handler << clip << localTime << expectedResults; @@ -1188,7 +1188,7 @@ private Q_SLOTS: handler = new Handler(); clip = createAnimationClipLoader(handler, QUrl("qrc:/clip1.json")); localTime = clip->duration(); - expectedResults = QList<float> { 5.0f, 0.0f, 0.0f }; + expectedResults = QVector<float> { 5.0f, 0.0f, 0.0f }; QTest::newRow("clip1.json, t = duration") << handler << clip << localTime << expectedResults; @@ -1199,7 +1199,7 @@ private Q_SLOTS: handler = new Handler(); clip = createAnimationClipLoader(handler, QUrl("qrc:/clip1.json")); localTime = clip->duration() / 2.0f; - expectedResults = QList<float> { 2.5f, 0.0f, 0.0f }; + expectedResults = QVector<float> { 2.5f, 0.0f, 0.0f }; QTest::newRow("clip1.json, t = duration/2") << handler << clip << localTime << expectedResults; @@ -1210,7 +1210,7 @@ private Q_SLOTS: handler = new Handler(); clip = createAnimationClipLoader(handler, QUrl("qrc:/clip2.json")); localTime = 0.0f; - expectedResults = QList<float> { 0.0f, 0.0f, 0.0f, // Translation + expectedResults = QVector<float> { 0.0f, 0.0f, 0.0f, // Translation 1.0f, 0.0f, 0.0f, 0.0f }; // Rotation QTest::newRow("clip2.json, t = 0.0") @@ -1221,7 +1221,7 @@ private Q_SLOTS: handler = new Handler(); clip = createAnimationClipLoader(handler, QUrl("qrc:/clip2.json")); localTime = clip->duration(); - expectedResults = QList<float> { 5.0f, 0.0f, 0.0f, // Translation + expectedResults = QVector<float> { 5.0f, 0.0f, 0.0f, // Translation 0.0f, 0.0f, -1.0f, 0.0f }; // Rotation QTest::newRow("clip2.json, t = duration") @@ -1232,7 +1232,7 @@ private Q_SLOTS: handler = new Handler(); clip = createAnimationClipLoader(handler, QUrl("qrc:/clip2.json")); localTime = clip->duration() / 2.0f; - expectedResults = QList<float> { 2.5f, 0.0f, 0.0f, // Translation + expectedResults = QVector<float> { 2.5f, 0.0f, 0.0f, // Translation 0.5f, 0.0f, -0.5f, 0.0f }; // Rotation QTest::newRow("clip2.json, t = duration/2") @@ -1244,7 +1244,7 @@ private Q_SLOTS: handler = new Handler(); clip = createAnimationClipLoader(handler, QUrl("qrc:/clip4.json")); localTime = clip->duration(); - expectedResults = QList<float> { 5.0, -2.0f, 6.0f }; + expectedResults = QVector<float> { 5.0, -2.0f, 6.0f }; QTest::newRow("clip4.json, linear, t = duration") << handler << clip << localTime << expectedResults; @@ -1255,7 +1255,7 @@ private Q_SLOTS: handler = new Handler(); clip = createAnimationClipLoader(handler, QUrl("qrc:/clip4.json")); localTime = clip->duration() / 2.0f; - expectedResults = QList<float> { 2.5f, -1.0f, 3.0f }; + expectedResults = QVector<float> { 2.5f, -1.0f, 3.0f }; QTest::newRow("clip4.json, linear, t = duration/2") << handler << clip << localTime << expectedResults; @@ -1266,7 +1266,7 @@ private Q_SLOTS: handler = new Handler(); clip = createAnimationClipLoader(handler, QUrl("qrc:/clip6.json")); localTime = clip->duration() / 2.0f; - expectedResults = QList<float> { 0.923822f, 0.382626f, 0.0f, 0.0f }; + expectedResults = QVector<float> { 0.923822f, 0.382626f, 0.0f, 0.0f }; QTest::newRow("clip6.json, slerp, t = duration/2") << handler << clip << localTime << expectedResults; @@ -1314,7 +1314,7 @@ private Q_SLOTS: handler = new Handler(); clip = createAnimationClipLoader(handler, QUrl("qrc:/clip1.json")); phase = 0.0f; - expectedResults = QList<float> { 0.0f, 0.0f, 0.0f }; + expectedResults = QVector<float> { 0.0f, 0.0f, 0.0f }; QTest::newRow("clip1.json, phi = 0.0") << handler << clip << phase << expectedResults; @@ -1325,7 +1325,7 @@ private Q_SLOTS: handler = new Handler(); clip = createAnimationClipLoader(handler, QUrl("qrc:/clip1.json")); phase = 1.0f; - expectedResults = QList<float> { 5.0f, 0.0f, 0.0f }; + expectedResults = QVector<float> { 5.0f, 0.0f, 0.0f }; QTest::newRow("clip1.json, phi = 1.0") << handler << clip << phase << expectedResults; @@ -1336,7 +1336,7 @@ private Q_SLOTS: handler = new Handler(); clip = createAnimationClipLoader(handler, QUrl("qrc:/clip1.json")); phase = 0.5f; - expectedResults = QList<float> { 2.5f, 0.0f, 0.0f }; + expectedResults = QVector<float> { 2.5f, 0.0f, 0.0f }; QTest::newRow("clip1.json, phi = 0.5") << handler << clip << phase << expectedResults; @@ -1347,7 +1347,7 @@ private Q_SLOTS: handler = new Handler(); clip = createAnimationClipLoader(handler, QUrl("qrc:/clip2.json")); phase = 0.0f; - expectedResults = QList<float> { 0.0f, 0.0f, 0.0f, // Translation + expectedResults = QVector<float> { 0.0f, 0.0f, 0.0f, // Translation 1.0f, 0.0f, 0.0f, 0.0f }; // Rotation QTest::newRow("clip2.json, phi = 0.0") @@ -1358,7 +1358,7 @@ private Q_SLOTS: handler = new Handler(); clip = createAnimationClipLoader(handler, QUrl("qrc:/clip2.json")); phase = 1.0f; - expectedResults = QList<float> { 5.0f, 0.0f, 0.0f, // Translation + expectedResults = QVector<float> { 5.0f, 0.0f, 0.0f, // Translation 0.0f, 0.0f, -1.0f, 0.0f }; // Rotation QTest::newRow("clip2.json, t = 1.0") @@ -1369,7 +1369,7 @@ private Q_SLOTS: handler = new Handler(); clip = createAnimationClipLoader(handler, QUrl("qrc:/clip2.json")); phase = 0.5f; - expectedResults = QList<float> { 2.5f, 0.0f, 0.0f, // Translation + expectedResults = QVector<float> { 2.5f, 0.0f, 0.0f, // Translation 0.5f, 0.0f, -0.5f, 0.0f }; // Rotation QTest::newRow("clip2.json, phi = 0.5") @@ -1759,8 +1759,8 @@ private Q_SLOTS: QFETCH(QList<int>, expectedResults); // WHEN - const QList<int> actualResults = channelComponentsToIndicesHelper(channel, - expectedChannelComponentCount, offset, suffixes); + const QVector<int> actualResults = channelComponentsToIndicesHelper(channel, + expectedChannelComponentCount, offset, suffixes); // THEN QCOMPARE(actualResults.size(), expectedResults.size()); @@ -1902,8 +1902,8 @@ private Q_SLOTS: QFETCH(QList<int>, expectedResults); // WHEN - const QList<int> actualResults = channelComponentsToIndices(channel, - dataType, componentCount, offset); + const QVector<int> actualResults = channelComponentsToIndices(channel, + dataType, componentCount, offset); // THEN QCOMPARE(actualResults.size(), expectedResults.size()); @@ -2308,7 +2308,7 @@ private Q_SLOTS: QFETCH(QList<Qt3DCore::QNodeId>, expectedIds); // WHEN - const QList<Qt3DCore::QNodeId> actualIds = gatherValueNodesToEvaluate(handler, blendTreeRootId); + const QVector<Qt3DCore::QNodeId> actualIds = gatherValueNodesToEvaluate(handler, blendTreeRootId); // THEN QCOMPARE(actualIds.size(), expectedIds.size()); @@ -2797,7 +2797,7 @@ private Q_SLOTS: QFETCH(QList<ChannelNameAndType>, expectedResults); // WHEN - const QList<ChannelNameAndType> actualResults = buildRequiredChannelsAndTypes(handler, mapper); + const QVector<ChannelNameAndType> actualResults = buildRequiredChannelsAndTypes(handler, mapper); // THEN QCOMPARE(actualResults.size(), expectedResults.size()); @@ -2810,33 +2810,33 @@ private Q_SLOTS: void checkAssignChannelComponentIndices_data() { - QTest::addColumn<QList<ChannelNameAndType>>("allChannels"); - QTest::addColumn<QList<ComponentIndices>>("expectedResults"); + QTest::addColumn<QVector<ChannelNameAndType>>("allChannels"); + QTest::addColumn<QVector<ComponentIndices>>("expectedResults"); { - const QList<ChannelNameAndType> allChannels = { + const QVector<ChannelNameAndType> allChannels = { { QLatin1String("Location"), static_cast<int>(QMetaType::QVector3D), 3 } }; - const QList<ComponentIndices> expectedResults = { { 0, 1, 2 } }; + const QVector<ComponentIndices> expectedResults = { { 0, 1, 2 } }; QTest::newRow("vec3 location") << allChannels << expectedResults; } { - const QList<ChannelNameAndType> allChannels = { + const QVector<ChannelNameAndType> allChannels = { { QLatin1String("Location"), static_cast<int>(QMetaType::QVector3D), 3 }, { QLatin1String("Rotation"), static_cast<int>(QMetaType::QQuaternion), 4 } }; - const QList<ComponentIndices> expectedResults = { { 0, 1, 2 }, + const QVector<ComponentIndices> expectedResults = { { 0, 1, 2 }, { 3, 4, 5, 6 } }; QTest::newRow("vec3 location, quaterion rotation") << allChannels << expectedResults; } { - const QList<ChannelNameAndType> allChannels = { + const QVector<ChannelNameAndType> allChannels = { { QLatin1String("Location"), static_cast<int>(QMetaType::QVector3D), 3 }, { QLatin1String("Rotation"), static_cast<int>(QMetaType::QQuaternion), 4 }, { QLatin1String("BaseColor"), static_cast<int>(QMetaType::QVector3D), 3 }, @@ -2845,7 +2845,7 @@ private Q_SLOTS: { QLatin1String("MorphWeights"), static_cast<int>(QMetaType::QVariantList), 6 } }; - const QList<ComponentIndices> expectedResults = { + const QVector<ComponentIndices> expectedResults = { { 0, 1, 2 }, { 3, 4, 5, 6 }, { 7, 8, 9 }, @@ -2857,7 +2857,7 @@ private Q_SLOTS: } { - QList<ChannelNameAndType> allChannels; + QVector<ChannelNameAndType> allChannels; const int jointCount = 4; for (int i = 0; i < jointCount; ++i) { ChannelNameAndType locationDescription = { QLatin1String("Location"), static_cast<int>(QMetaType::QVector3D), 3 }; @@ -2873,7 +2873,7 @@ private Q_SLOTS: allChannels.push_back(scaleDescription); } - const QList<ComponentIndices> expectedResults = { + const QVector<ComponentIndices> expectedResults = { { 0, 1, 2 }, { 3, 4, 5, 6 }, { 7, 8, 9 }, { 10, 11, 12 }, { 13, 14, 15, 16 }, { 17, 18, 19 }, { 20, 21, 22 }, { 23, 24, 25, 26 }, { 27, 28, 29 }, @@ -2887,11 +2887,11 @@ private Q_SLOTS: void checkAssignChannelComponentIndices() { // GIVEN - QFETCH(QList<ChannelNameAndType>, allChannels); - QFETCH(QList<ComponentIndices>, expectedResults); + QFETCH(QVector<ChannelNameAndType>, allChannels); + QFETCH(QVector<ComponentIndices>, expectedResults); // WHEN - const QList<ComponentIndices> actualResults = assignChannelComponentIndices(allChannels); + const QVector<ComponentIndices> actualResults = assignChannelComponentIndices(allChannels); // THEN QCOMPARE(actualResults.size(), expectedResults.size()); @@ -2906,13 +2906,13 @@ private Q_SLOTS: void checkGenerateClipFormatIndices_data() { - QTest::addColumn<QList<ChannelNameAndType>>("targetChannels"); - QTest::addColumn<QList<ComponentIndices>>("targetIndices"); + QTest::addColumn<QVector<ChannelNameAndType>>("targetChannels"); + QTest::addColumn<QVector<ComponentIndices>>("targetIndices"); QTest::addColumn<AnimationClip *>("clip"); QTest::addColumn<ClipFormat>("expectedResults"); { - const QList<ChannelNameAndType> targetChannels = { + const QVector<ChannelNameAndType> targetChannels = { { QLatin1String("Rotation"), static_cast<int>(QMetaType::QQuaternion), 4 }, { QLatin1String("Location"), static_cast<int>(QMetaType::QVector3D), 3 }, { QLatin1String("Base Color"), static_cast<int>(QMetaType::QVector3D), 3 }, @@ -2920,7 +2920,7 @@ private Q_SLOTS: { QLatin1String("Roughness"), static_cast<int>(QMetaType::Double), 1 } }; - const QList<ComponentIndices> targetIndices = { + const QVector<ComponentIndices> targetIndices = { { 0, 1, 2, 3 }, { 4, 5, 6 }, { 7, 8, 9 }, @@ -2952,7 +2952,7 @@ private Q_SLOTS: } { - const QList<ChannelNameAndType> targetChannels = { + const QVector<ChannelNameAndType> targetChannels = { { QLatin1String("Location"), static_cast<int>(QMetaType::QVector3D), 3 }, { QLatin1String("Rotation"), static_cast<int>(QMetaType::QQuaternion), 4 }, { QLatin1String("Base Color"), static_cast<int>(QMetaType::QVector3D), 3 }, @@ -2960,7 +2960,7 @@ private Q_SLOTS: { QLatin1String("Roughness"), static_cast<int>(QMetaType::Double), 1 } }; - const QList<ComponentIndices> targetIndices = { + const QVector<ComponentIndices> targetIndices = { { 0, 1, 2 }, { 3, 4, 5, 6 }, { 7, 8, 9 }, @@ -2992,7 +2992,7 @@ private Q_SLOTS: } { - const QList<ChannelNameAndType> targetChannels = { + const QVector<ChannelNameAndType> targetChannels = { { QLatin1String("Rotation"), static_cast<int>(QMetaType::QQuaternion), 4 }, { QLatin1String("Location"), static_cast<int>(QMetaType::QVector3D), 3 }, { QLatin1String("Albedo"), static_cast<int>(QMetaType::QVector3D), 3 }, @@ -3000,7 +3000,7 @@ private Q_SLOTS: { QLatin1String("Roughness"), static_cast<int>(QMetaType::Double), 1 } }; - const QList<ComponentIndices> targetIndices = { + const QVector<ComponentIndices> targetIndices = { { 0, 1, 2, 3 }, { 4, 5, 6 }, { 7, 8, 9 }, @@ -3032,7 +3032,7 @@ private Q_SLOTS: } { - const QList<ChannelNameAndType> targetChannels = { + const QVector<ChannelNameAndType> targetChannels = { { QLatin1String("Location"), static_cast<int>(QMetaType::QVector3D), 3 }, { QLatin1String("Rotation"), static_cast<int>(QMetaType::QQuaternion), 4 }, { QLatin1String("Albedo"), static_cast<int>(QMetaType::QVector3D), 3 }, @@ -3040,7 +3040,7 @@ private Q_SLOTS: { QLatin1String("Roughness"), static_cast<int>(QMetaType::Double), 1 } }; - const QList<ComponentIndices> targetIndices = { + const QVector<ComponentIndices> targetIndices = { { 0, 1, 2 }, { 3, 4, 5, 6 }, { 7, 8, 9 }, @@ -3072,7 +3072,7 @@ private Q_SLOTS: } { - QList<ChannelNameAndType> targetChannels; + QVector<ChannelNameAndType> targetChannels; const int jointCount = 4; for (int i = 0; i < jointCount; ++i) { ChannelNameAndType locationDescription = { QLatin1String("Location"), static_cast<int>(QMetaType::QVector3D), 3 }; @@ -3088,7 +3088,7 @@ private Q_SLOTS: targetChannels.push_back(scaleDescription); } - const QList<ComponentIndices> targetIndices = { + const QVector<ComponentIndices> targetIndices = { { 0, 1, 2 }, { 3, 4, 5, 6 }, { 7, 8, 9 }, { 10, 11, 12 }, { 13, 14, 15, 16 }, { 17, 18, 19 }, { 20, 21, 22 }, { 23, 24, 25, 26 }, { 27, 28, 29 }, @@ -3136,8 +3136,8 @@ private Q_SLOTS: void checkGenerateClipFormatIndices() { // GIVEN - QFETCH(QList<ChannelNameAndType>, targetChannels); - QFETCH(QList<ComponentIndices>, targetIndices); + QFETCH(QVector<ChannelNameAndType>, targetChannels); + QFETCH(QVector<ComponentIndices>, targetIndices); QFETCH(AnimationClip *, clip); QFETCH(ClipFormat, expectedResults); @@ -3171,7 +3171,7 @@ private Q_SLOTS: { QTest::addColumn<Handler *>("handler"); QTest::addColumn<ChannelNameAndType>("channelDescription"); - QTest::addColumn<QList<float>>("expectedResults"); + QTest::addColumn<QVector<float>>("expectedResults"); { auto handler = new Handler(); @@ -3185,7 +3185,7 @@ private Q_SLOTS: channelDescription.mappingId = channelMapping->peerId(); channelDescription.type = static_cast<int>(QMetaType::QVector3D); channelDescription.name = QLatin1String("translation"); - const QList<float> expectedResults = { 0.0f, 0.0f, 0.0f }; + const QVector<float> expectedResults = { 0.0f, 0.0f, 0.0f }; QTest::newRow("translation") << handler << channelDescription << expectedResults; } @@ -3201,7 +3201,7 @@ private Q_SLOTS: channelDescription.mappingId = channelMapping->peerId(); channelDescription.type = static_cast<int>(QMetaType::QQuaternion); channelDescription.name = QLatin1String("rotation"); - const QList<float> expectedResults = { 1.0f, 0.0f, 0.0f, 0.0f }; + const QVector<float> expectedResults = { 1.0f, 0.0f, 0.0f, 0.0f }; QTest::newRow("rotation") << handler << channelDescription << expectedResults; } @@ -3217,7 +3217,7 @@ private Q_SLOTS: channelDescription.mappingId = channelMapping->peerId(); channelDescription.type = static_cast<int>(QMetaType::QVector3D); channelDescription.name = QLatin1String("scale"); - const QList<float> expectedResults = { 1.0f, 1.0f, 1.0f }; + const QVector<float> expectedResults = { 1.0f, 1.0f, 1.0f }; QTest::newRow("scale") << handler << channelDescription << expectedResults; } @@ -3233,7 +3233,7 @@ private Q_SLOTS: channelDescription.type = static_cast<int>(QMetaType::QVector3D); channelDescription.jointIndex = 0; channelDescription.jointTransformComponent = Scale; - const QList<float> expectedResults = { 2.0f, 3.0f, 4.0f }; + const QVector<float> expectedResults = { 2.0f, 3.0f, 4.0f }; QTest::newRow("joint 0 scale") << handler << channelDescription << expectedResults; } @@ -3248,7 +3248,7 @@ private Q_SLOTS: channelDescription.type = static_cast<int>(QMetaType::QVector3D); channelDescription.jointIndex = 0; channelDescription.jointTransformComponent = Rotation; - const QList<float> expectedResults = { 1.0f, 0.0f, 0.0f, 0.0f }; + const QVector<float> expectedResults = { 1.0f, 0.0f, 0.0f, 0.0f }; QTest::newRow("joint 0 rotation") << handler << channelDescription << expectedResults; } @@ -3263,7 +3263,7 @@ private Q_SLOTS: channelDescription.type = static_cast<int>(QMetaType::QVector3D); channelDescription.jointIndex = 0; channelDescription.jointTransformComponent = Translation; - const QList<float> expectedResults = { 2.0f, 3.0f, 4.0f }; + const QVector<float> expectedResults = { 2.0f, 3.0f, 4.0f }; QTest::newRow("joint 0 translation") << handler << channelDescription << expectedResults; } @@ -3278,7 +3278,7 @@ private Q_SLOTS: channelDescription.type = static_cast<int>(QMetaType::QVector3D); channelDescription.jointIndex = 1; channelDescription.jointTransformComponent = Scale; - const QList<float> expectedResults = { 20.0f, 30.0f, 40.0f }; + const QVector<float> expectedResults = { 20.0f, 30.0f, 40.0f }; QTest::newRow("joint 1 scale") << handler << channelDescription << expectedResults; } @@ -3293,7 +3293,7 @@ private Q_SLOTS: channelDescription.type = static_cast<int>(QMetaType::QVector3D); channelDescription.jointIndex = 1; channelDescription.jointTransformComponent = Rotation; - const QList<float> expectedResults = { 1.0f, 0.0f, 0.0f, 0.0f }; + const QVector<float> expectedResults = { 1.0f, 0.0f, 0.0f, 0.0f }; QTest::newRow("joint 1 rotation") << handler << channelDescription << expectedResults; } @@ -3308,7 +3308,7 @@ private Q_SLOTS: channelDescription.type = static_cast<int>(QMetaType::QVector3D); channelDescription.jointIndex = 1; channelDescription.jointTransformComponent = Translation; - const QList<float> expectedResults = { 4.0f, 5.0f, 6.0f }; + const QVector<float> expectedResults = { 4.0f, 5.0f, 6.0f }; QTest::newRow("joint 1 translation") << handler << channelDescription << expectedResults; } } @@ -3318,7 +3318,7 @@ private Q_SLOTS: // GIVEN QFETCH(Handler *, handler); QFETCH(ChannelNameAndType, channelDescription); - QFETCH(QList<float>, expectedResults); + QFETCH(QVector<float>, expectedResults); // WHEN auto actualResults = defaultValueForChannel(handler, channelDescription); diff --git a/tests/auto/animation/bezierevaluator/tst_bezierevaluator.cpp b/tests/auto/animation/bezierevaluator/tst_bezierevaluator.cpp index aa3679aef..a6460e4ef 100644 --- a/tests/auto/animation/bezierevaluator/tst_bezierevaluator.cpp +++ b/tests/auto/animation/bezierevaluator/tst_bezierevaluator.cpp @@ -79,7 +79,7 @@ private Q_SLOTS: float c = 0.0f; float d = 0.0f; int rootCount = 1; - QList<float> roots = { 0.0f }; + QVector<float> roots = { 0.0f }; QTest::newRow("a=1, b=0, c=0, d=0") << a << b << c << d << rootCount << roots; roots.clear(); diff --git a/tests/auto/animation/clipblendnode/tst_clipblendnode.cpp b/tests/auto/animation/clipblendnode/tst_clipblendnode.cpp index 9a2d9765b..7cddbbb39 100644 --- a/tests/auto/animation/clipblendnode/tst_clipblendnode.cpp +++ b/tests/auto/animation/clipblendnode/tst_clipblendnode.cpp @@ -221,7 +221,7 @@ private Q_SLOTS: blendNode->setClipResults(animatorId, clipResults); } - QList<int> indexes(animatorCount); + QVector<int> indexes(animatorCount); std::iota(indexes.begin(), indexes.end(), 0); QTest::newRow("multiple entries, ordered") @@ -248,7 +248,7 @@ private Q_SLOTS: } // Shuffle the animatorIds to randomise the lookups - QList<int> indexes(animatorCount); + QVector<int> indexes(animatorCount); std::iota(indexes.begin(), indexes.end(), 0); std::random_device rd; std::mt19937 generator(rd()); @@ -263,7 +263,7 @@ private Q_SLOTS: { // GIVEN QFETCH(TestClipBlendNode *, blendNode); - QFETCH(QList<int>, indexes); + QFETCH(QVector<int>, indexes); QFETCH(QList<Qt3DCore::QNodeId>, animatorIds); QFETCH(QList<ClipResults>, expectedClipResults); diff --git a/tests/auto/animation/clipblendvalue/tst_clipblendvalue.cpp b/tests/auto/animation/clipblendvalue/tst_clipblendvalue.cpp index fce78a0e0..141da6d4c 100644 --- a/tests/auto/animation/clipblendvalue/tst_clipblendvalue.cpp +++ b/tests/auto/animation/clipblendvalue/tst_clipblendvalue.cpp @@ -211,7 +211,7 @@ private Q_SLOTS: blendNode->setClipFormat(animatorId, clipFormat); } - QList<int> indexes(animatorCount); + QVector<int> indexes(animatorCount); std::iota(indexes.begin(), indexes.end(), 0); QTest::newRow("multiple entries, ordered") @@ -238,7 +238,7 @@ private Q_SLOTS: } // Shuffle the animatorIds to randomise the lookups - QList<int> indexes(animatorCount); + QVector<int> indexes(animatorCount); std::iota(indexes.begin(), indexes.end(), 0); std::random_device rd; std::mt19937 generator(rd()); diff --git a/tests/auto/animation/findrunningclipanimatorsjob/tst_findrunningclipanimatorsjob.cpp b/tests/auto/animation/findrunningclipanimatorsjob/tst_findrunningclipanimatorsjob.cpp index aea512f1c..7d8ef5723 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(QList<Qt3DAnimation::Animation::HClipAnimator>) +Q_DECLARE_METATYPE(QVector<Qt3DAnimation::Animation::HClipAnimator>) -using MappingDataResults = QHash<ClipAnimator *, QList<Qt3DAnimation::Animation::MappingData>>; +using MappingDataResults = QHash<ClipAnimator *, QVector<Qt3DAnimation::Animation::MappingData>>; Q_DECLARE_METATYPE(MappingDataResults) class tst_FindRunningClipAnimatorsJob: public Qt3DCore::QBackendNodeTester @@ -116,7 +116,7 @@ private Q_SLOTS: void checkJob_data() { QTest::addColumn<Handler *>("handler"); - QTest::addColumn<QList<HClipAnimator>>("dirtyClipAnimators"); + QTest::addColumn<QVector<HClipAnimator>>("dirtyClipAnimators"); QTest::addColumn<MappingDataResults>("expectedResults"); @@ -133,7 +133,7 @@ private Q_SLOTS: const int loops = 1; animator = createClipAnimator(handler, globalStartTimeNS, loops); animator->setClipId(clip->peerId()); - const QList<HClipAnimator> dirtyClipAnimators + const QVector<HClipAnimator> dirtyClipAnimators = { handler->clipAnimatorManager()->getOrAcquireHandle(animator->peerId()) }; auto channelMapping = createChannelMapping(handler, @@ -153,7 +153,7 @@ private Q_SLOTS: expectedMapping.propertyName = channelMapping->propertyName(); expectedMapping.type = channelMapping->type(); expectedMapping.channelIndices = locationIndices; - expectedResults.insert(animator, QList<MappingData> { expectedMapping }); + expectedResults.insert(animator, QVector<MappingData> { expectedMapping }); QTest::newRow("single mapping") << handler @@ -174,7 +174,7 @@ private Q_SLOTS: const int loops = 1; animator = createClipAnimator(handler, globalStartTimeNS, loops); animator->setClipId(clip->peerId()); - const QList<HClipAnimator> dirtyClipAnimators + const QVector<HClipAnimator> dirtyClipAnimators = { handler->clipAnimatorManager()->getOrAcquireHandle(animator->peerId()) }; auto channelMapping = createChannelMapping(handler, @@ -199,7 +199,7 @@ private Q_SLOTS: { // GIVEN QFETCH(Handler *, handler); - QFETCH(QList<HClipAnimator>, dirtyClipAnimators); + QFETCH(QVector<HClipAnimator>, dirtyClipAnimators); QFETCH(MappingDataResults, expectedResults); FindRunningClipAnimatorsJob job; @@ -211,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 QList<MappingData> actualMappingData = animator->mappingData(); - const QList<MappingData> expectedMappingData = expectedResults[animator]; + const QVector<MappingData> actualMappingData = animator->mappingData(); + const QVector<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 05e05ab98..7649eacca 100644 --- a/tests/auto/animation/functionrangefinder/tst_functionrangefinder.cpp +++ b/tests/auto/animation/functionrangefinder/tst_functionrangefinder.cpp @@ -56,7 +56,7 @@ private Q_SLOTS: QTest::addColumn<int>("correlationThreshold"); QTest::addColumn<bool>("ascending"); - QList<float> data = { 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f }; + QVector<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; @@ -101,9 +101,9 @@ private Q_SLOTS: QTest::addColumn<QList<float>>("needles"); QTest::addColumn<QList<int>>("lowerBounds"); - 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 }; + 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 }; QTest::newRow("10 entries, ascending") << data << needles << lowerBounds; data.clear(); needles.clear(); diff --git a/tests/auto/animation/qchannelmapping/tst_qchannelmapping.cpp b/tests/auto/animation/qchannelmapping/tst_qchannelmapping.cpp index dd40192b8..604b4032e 100644 --- a/tests/auto/animation/qchannelmapping/tst_qchannelmapping.cpp +++ b/tests/auto/animation/qchannelmapping/tst_qchannelmapping.cpp @@ -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>(QMetaType::QVariantList) << 5; - QList<float> vec(8); + QVector<float> vec(8); QTest::newRow("vector") << QByteArrayLiteral("vecProperty") << QVariant::fromValue(vec) << qMetaTypeId<decltype(vec)>() << 8; } diff --git a/tests/auto/animation/qmorphinganimation/tst_qmorphinganimation.cpp b/tests/auto/animation/qmorphinganimation/tst_qmorphinganimation.cpp index faf6c7416..3020113b1 100644 --- a/tests/auto/animation/qmorphinganimation/tst_qmorphinganimation.cpp +++ b/tests/auto/animation/qmorphinganimation/tst_qmorphinganimation.cpp @@ -186,14 +186,14 @@ private Q_SLOTS: morphingAnimation.addMorphTarget(mt2); morphingAnimation.addMorphTarget(mt3); - const QList<float> positions = { 0.0f, 1.0f, 2.0f, 3.0f, 4.0f }; + const QVector<float> positions = { 0.0f, 1.0f, 2.0f, 3.0f, 4.0f }; morphingAnimation.setTargetPositions(positions); - 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.setWeights(0, QVector<float> { 1.0f, 0.0f, 0.0f }); + morphingAnimation.setWeights(1, QVector<float> { 0.0f, 0.0f, 0.0f }); + morphingAnimation.setWeights(2, QVector<float> { 0.0f, 1.0f, 0.0f }); + morphingAnimation.setWeights(3, QVector<float> { 0.0f, 0.0f, 0.0f }); + morphingAnimation.setWeights(4, QVector<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 a17bfcab5..24883e343 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 QList<QString> jointNames = { QLatin1String("rootJoint"), + const QVector<QString> jointNames = { QLatin1String("rootJoint"), QLatin1String("child1Joint"), QLatin1String("child2Joint") }; @@ -103,10 +103,10 @@ private Q_SLOTS: QCOMPARE(backendSkeleton.jointLocalPoses().size(), 0); // GIVEN - const QList<QString> names = { QLatin1String("root"), - QLatin1String("child1"), - QLatin1String("child2") }; - const QList<Sqt> localPoses = { Sqt(), Sqt(), Sqt() }; + const QVector<QString> names = { QLatin1String("root"), + QLatin1String("child1"), + QLatin1String("child2") }; + const QVector<Sqt> localPoses = { Sqt(), Sqt(), Sqt() }; // WHEN backendSkeleton.setJointNames(names); diff --git a/tests/auto/core/nodes/tst_nodes.cpp b/tests/auto/core/nodes/tst_nodes.cpp index fcc38797e..1edaf42ce 100644 --- a/tests/auto/core/nodes/tst_nodes.cpp +++ b/tests/auto/core/nodes/tst_nodes.cpp @@ -1117,10 +1117,10 @@ void tst_Nodes::removingMultipleChildNodesFromNode() QVERIFY(Qt3DCore::QNodePrivate::get(root.data())->scene() != nullptr); // WHEN - Qt3DCore::QNodeIdVector childIds(10); + Qt3DCore::QNodeIdVector childIds; for (int i = 0; i < 10; i++) { auto child = new MyQNode(root.data()); - childIds[i] = child->id(); + childIds.push_back(child->id()); } QCoreApplication::processEvents(); diff --git a/tests/auto/render/opengl/qgraphicsutils/tst_qgraphicsutils.cpp b/tests/auto/render/opengl/qgraphicsutils/tst_qgraphicsutils.cpp index 9f452cd24..aefbeffbe 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; - QList<GLfloat> data(16); + QVector<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 b06025b50..ca176f7c2 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); - QList<Qt3DRender::Render::OpenGL::RenderView *> renderViews(7); + QVector<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); - QList<Qt3DRender::Render::OpenGL::RenderView *> renderViews(7); + QVector<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 - QList<Qt3DRender::Render::OpenGL::RenderView *> renderViews(5); + QVector<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/uniform/tst_uniform.cpp b/tests/auto/render/uniform/tst_uniform.cpp index 3a3ee5667..8e7a50579 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 QList<QMatrix4x4> matrices = { m1, m2, m3, m4 }; + const QVector<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 QList<QMatrix4x4> matrices1 = { m1, m2, m3, m4 }; + const QVector<QMatrix4x4> matrices1 = { m1, m2, m3, m4 }; UniformValue v(matrices1); // WHEN - const QList<QMatrix4x4> matrices2 = { m4, m3, m2, m1, m4 }; + const QVector<QMatrix4x4> matrices2 = { m4, m3, m2, m1, m4 }; v.setData(matrices2); // THEN @@ -405,7 +405,7 @@ private Q_SLOTS: // GIVEN const int positionCount = 10; - QList<QVector3D> positions(positionCount); + QVector<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/benchmarks/core/qresourcesmanager/arraypolicy/tst_bench_arraypolicy.cpp b/tests/benchmarks/core/qresourcesmanager/arraypolicy/tst_bench_arraypolicy.cpp index d0b105bb9..5bac867d7 100644 --- a/tests/benchmarks/core/qresourcesmanager/arraypolicy/tst_bench_arraypolicy.cpp +++ b/tests/benchmarks/core/qresourcesmanager/arraypolicy/tst_bench_arraypolicy.cpp @@ -69,8 +69,8 @@ void benchmarkReleaseResources() Qt3DCore::ArrayAllocatingPolicy<T> allocator; const int max = (1 << 16) - 1; - QList<Qt3DCore::QHandle<T>> resources(max); - for (int i = 0; i < max; i++) { + std::vector<Qt3DCore::QHandle<T>> resources(max); + for (size_t 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 6d41bdce0..b82c90ba5 100644 --- a/tests/benchmarks/core/qresourcesmanager/qresourcesmanager/tst_bench_qresourcesmanager.cpp +++ b/tests/benchmarks/core/qresourcesmanager/qresourcesmanager/tst_bench_qresourcesmanager.cpp @@ -85,14 +85,14 @@ template<typename Resource> void benchmarkAccessResources() { Qt3DCore::QResourceManager<Resource, int> manager; - const int max = (1 << 16) - 1; - QList<Qt3DCore::QHandle<Resource> > handles(max); - for (int i = 0; i < max; i++) + const size_t max = (1 << 16) - 1; + std::vector<Qt3DCore::QHandle<Resource> > handles(max); + for (size_t i = 0; i < max; i++) handles[i] = manager.acquire(); volatile Resource *c; QBENCHMARK { - for (int i = 0; i < max; i++) + for (size_t i = 0; i < max; i++) c = manager.data(handles[i]); } Q_UNUSED(c); @@ -101,9 +101,9 @@ void benchmarkAccessResources() template<typename Resource> void benchmarkRandomAccessResource() { Qt3DCore::QResourceManager<Resource, int> manager; - const int max = (1 << 16) - 1; - QList<Qt3DCore::QHandle<Resource> > handles(max); - for (int i = 0; i < max; i++) + const size_t max = (1 << 16) - 1; + std::vector<Qt3DCore::QHandle<Resource> > handles(max); + for (size_t i = 0; i < max; i++) handles[i] = manager.acquire(); std::random_device rd; @@ -112,7 +112,7 @@ void benchmarkRandomAccessResource() { volatile Resource *c; QBENCHMARK { - for (int i = 0; i < max; i++) + for (size_t i = 0; i < max; i++) c = manager.data(handles[i]); } Q_UNUSED(c); @@ -139,7 +139,7 @@ void benchmarkRandomLookupResources() { Qt3DCore::QResourceManager<Resource, int> manager; const int max = (1 << 16) - 1; - QList<int> resourcesIndices(max); + QVector<int> resourcesIndices(max); for (int i = 0; i < max; i++) { manager.getOrCreateResource(i); resourcesIndices[i] = i; @@ -161,11 +161,11 @@ template<typename Resource> void benchmarkReleaseResources() { Qt3DCore::QResourceManager<Resource, int> manager; - const int max = (1 << 16) - 1; - QList<Qt3DCore::QHandle<Resource> > handles(max); - for (int i = 0; i < max; i++) + const size_t max = (1 << 16) - 1; + std::vector<Qt3DCore::QHandle<Resource> > handles(max); + for (size_t i = 0; i < max; i++) handles[i] = manager.acquire(); - for (int i = 0; i < max; i++) + for (size_t i = 0; i < max; i++) manager.release(handles.at(i)); handles.clear(); diff --git a/tests/benchmarks/render/opengl/shaderparameterpack/tst_bench_shaderparameterpack.cpp b/tests/benchmarks/render/opengl/shaderparameterpack/tst_bench_shaderparameterpack.cpp index 16ecfc99e..5b014983a 100644 --- a/tests/benchmarks/render/opengl/shaderparameterpack/tst_bench_shaderparameterpack.cpp +++ b/tests/benchmarks/render/opengl/shaderparameterpack/tst_bench_shaderparameterpack.cpp @@ -47,10 +47,10 @@ private Q_SLOTS: // GIVEN PackUniformHash pack; - QList<int> randKeys(64); + std::vector<int> randKeys(64); QRandomGenerator gen; - for (int i = 0; i < 64; ++i) + for (size_t i = 0; i < 64; ++i) randKeys[i] = gen.generate(); QBENCHMARK { diff --git a/tests/manual/custom-mesh-cpp-indirect/main.cpp b/tests/manual/custom-mesh-cpp-indirect/main.cpp index 87ca2b2dc..dcdbbfcd9 100644 --- a/tests/manual/custom-mesh-cpp-indirect/main.cpp +++ b/tests/manual/custom-mesh-cpp-indirect/main.cpp @@ -303,7 +303,7 @@ int main(int argc, char* argv[]) Qt3DCore::QBuffer *indirectDrawDataBuffer = new Qt3DCore::QBuffer(customGeometry); - QList<QVector3D> orderedPositionVertices; + QVector<QVector3D> orderedPositionVertices; // 12 vertices with position, normal, color orderedPositionVertices.reserve(12 * (1 + 1 + 1)); |