From 173be1a93699c54d9680d809ca5a56ce0ccccd9a Mon Sep 17 00:00:00 2001 From: Mike Krus Date: Fri, 20 Nov 2020 16:47:37 +0000 Subject: 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 --- .../backend/abstractevaluateclipanimatorjob.cpp | 4 +- .../backend/abstractevaluateclipanimatorjob_p.h | 2 +- src/animation/backend/animationclip_p.h | 9 +- src/animation/backend/animationutils.cpp | 58 ++-- src/animation/backend/animationutils_p.h | 46 +-- src/animation/backend/blendedclipanimator_p.h | 6 +- src/animation/backend/buildblendtreesjob.cpp | 27 +- src/animation/backend/buildblendtreesjob_p.h | 4 +- src/animation/backend/channelmapper_p.h | 10 +- src/animation/backend/clipanimator_p.h | 6 +- .../backend/evaluateblendclipanimatorjob.cpp | 4 +- src/animation/backend/fcurve_p.h | 2 +- .../backend/findrunningclipanimatorsjob.cpp | 10 +- .../backend/findrunningclipanimatorsjob_p.h | 4 +- src/animation/backend/gltfimporter.cpp | 2 +- src/animation/backend/gltfimporter_p.h | 2 +- src/animation/backend/handler.cpp | 8 +- src/animation/backend/handler_p.h | 24 +- src/animation/backend/loadanimationclipjob.cpp | 2 +- src/animation/backend/loadanimationclipjob_p.h | 4 +- src/animation/backend/skeleton_p.h | 14 +- src/animation/frontend/qanimationclipdata.cpp | 2 +- src/animation/frontend/qchannel.cpp | 2 +- src/animation/frontend/qchannelcomponent.cpp | 2 +- src/animation/frontend/qmorphinganimation.cpp | 20 +- src/animation/frontend/qmorphinganimation.h | 16 +- src/animation/frontend/qmorphinganimation_p.h | 8 +- src/core/resources/qframeallocator_p_p.h | 4 +- src/core/transforms/qabstractskeleton_p.h | 4 +- src/extras/3dtext/qextrudedtextgeometry.cpp | 14 +- src/extras/text/distancefieldtextrenderer.cpp | 4 +- src/extras/text/distancefieldtextrenderer_p.h | 4 +- src/extras/text/qdistancefieldglyphcache.cpp | 4 +- src/extras/text/qtext2dentity.cpp | 8 +- src/input/backend/movingaverage_p.h | 2 +- src/plugins/sceneparsers/gltf/gltfimporter.cpp | 4 +- .../sceneparsers/gltfexport/gltfexporter.cpp | 2 +- src/plugins/sceneparsers/gltfexport/gltfexporter.h | 4 +- src/render/backend/uniform.cpp | 2 +- src/render/backend/uniform_p.h | 6 +- src/render/geometry/gltfskeletonloader_p.h | 10 +- src/render/geometry/skeleton.cpp | 6 +- src/render/geometry/skeleton_p.h | 10 +- src/render/geometry/skeletondata_p.h | 6 +- src/render/jobs/updateskinningpalettejob.cpp | 2 +- .../animationutils/tst_animationutils.cpp | 318 ++++++++++----------- .../bezierevaluator/tst_bezierevaluator.cpp | 2 +- .../animation/clipblendnode/tst_clipblendnode.cpp | 6 +- .../clipblendvalue/tst_clipblendvalue.cpp | 4 +- .../tst_findrunningclipanimatorsjob.cpp | 18 +- .../tst_functionrangefinder.cpp | 8 +- .../qchannelmapping/tst_qchannelmapping.cpp | 2 +- .../qmorphinganimation/tst_qmorphinganimation.cpp | 12 +- tests/auto/animation/skeleton/tst_skeleton.cpp | 10 +- tests/auto/core/nodes/tst_nodes.cpp | 4 +- .../opengl/qgraphicsutils/tst_qgraphicsutils.cpp | 2 +- .../render/opengl/renderqueue/tst_renderqueue.cpp | 6 +- tests/auto/render/uniform/tst_uniform.cpp | 8 +- .../arraypolicy/tst_bench_arraypolicy.cpp | 4 +- .../tst_bench_qresourcesmanager.cpp | 26 +- .../tst_bench_shaderparameterpack.cpp | 4 +- tests/manual/custom-mesh-cpp-indirect/main.cpp | 2 +- 62 files changed, 414 insertions(+), 416 deletions(-) diff --git a/src/animation/backend/abstractevaluateclipanimatorjob.cpp b/src/animation/backend/abstractevaluateclipanimatorjob.cpp index 43c1de260..5267d4526 100644 --- a/src/animation/backend/abstractevaluateclipanimatorjob.cpp +++ b/src/animation/backend/abstractevaluateclipanimatorjob.cpp @@ -54,7 +54,7 @@ public: void postFrame(Qt3DCore::QAspectManager *manager) override; AnimationRecord m_record; - QList m_callbacks; + QVector m_callbacks; }; AbstractEvaluateClipAnimatorJob::AbstractEvaluateClipAnimatorJob() @@ -62,7 +62,7 @@ AbstractEvaluateClipAnimatorJob::AbstractEvaluateClipAnimatorJob() { } -void AbstractEvaluateClipAnimatorJob::setPostFrameData(const AnimationRecord &record, const QList &callbacks) +void AbstractEvaluateClipAnimatorJob::setPostFrameData(const AnimationRecord &record, const QVector &callbacks) { auto mainThreadCB = callbacks; mainThreadCB.erase(std::remove_if(mainThreadCB.begin(), mainThreadCB.end(), [](const AnimationCallbackAndValue &callback) { diff --git a/src/animation/backend/abstractevaluateclipanimatorjob_p.h b/src/animation/backend/abstractevaluateclipanimatorjob_p.h index 5bf88978a..2a8914faa 100644 --- a/src/animation/backend/abstractevaluateclipanimatorjob_p.h +++ b/src/animation/backend/abstractevaluateclipanimatorjob_p.h @@ -63,7 +63,7 @@ class AbstractEvaluateClipAnimatorJob : public Qt3DCore::QAspectJob protected: AbstractEvaluateClipAnimatorJob(); - void setPostFrameData(const AnimationRecord &record, const QList &callbacks); + void setPostFrameData(const AnimationRecord &record, const QVector &callbacks); private: Q_DECLARE_PRIVATE(AbstractEvaluateClipAnimatorJob) diff --git a/src/animation/backend/animationclip_p.h b/src/animation/backend/animationclip_p.h index 38bc117fe..23c564171 100644 --- a/src/animation/backend/animationclip_p.h +++ b/src/animation/backend/animationclip_p.h @@ -78,7 +78,7 @@ public: void addDependingBlendedClipAnimator(const Qt3DCore::QNodeId &id); QString name() const { return m_name; } - const QList &channels() const { return m_channels; } + const QVector &channels() const { return m_channels; } // Called from jobs void loadAnimation(); @@ -117,7 +117,7 @@ private: ClipDataType m_dataType; QString m_name; - QList m_channels; + QVector m_channels; float m_duration; int m_channelComponentCount; @@ -134,10 +134,9 @@ inline QDebug operator<<(QDebug dbg, const AnimationClip &animationClip) << "Duration: " << animationClip.duration() << Qt::endl << "Channels:" << Qt::endl; - const QList channels = animationClip.channels(); - for (const auto &channel : channels) { + const auto &channels = animationClip.channels(); + for (const auto &channel : channels) dbg << channel; - } return dbg; } diff --git a/src/animation/backend/animationutils.cpp b/src/animation/backend/animationutils.cpp index e2cb04c15..0c1bd96dc 100644 --- a/src/animation/backend/animationutils.cpp +++ b/src/animation/backend/animationutils.cpp @@ -60,12 +60,12 @@ const auto slerpThreshold = 0.01f; namespace Qt3DAnimation { namespace Animation { -inline QList valueToVector(const QVector3D &value) +inline QVector valueToVector(const QVector3D &value) { return { value.x(), value.y(), value.z() }; } -inline QList valueToVector(const QQuaternion &value) +inline QVector valueToVector(const QQuaternion &value) { return { value.scalar(), value.x(), value.y(), value.z() }; } @@ -227,14 +227,14 @@ ComponentIndices channelComponentsToIndicesHelper(const Channel &channel, ClipResults evaluateClipAtLocalTime(AnimationClip *clip, float localTime) { - QList channelResults; + QVector channelResults; Q_ASSERT(clip); // Ensure we have enough storage to hold the evaluations channelResults.resize(clip->channelCount()); // Iterate over channels and evaluate the fcurves - const QList &channels = clip->channels(); + const auto &channels = clip->channels(); int i = 0; for (const Channel &channel : channels) { if (channel.name.contains(QStringLiteral("Rotation")) && @@ -330,7 +330,7 @@ ClipResults evaluateClipAtPhase(AnimationClip *clip, float phase) template Container mapChannelResultsToContainer(const MappingData &mappingData, - const QList &channelResults) + const QVector &channelResults) { Container r; r.reserve(channelResults.size()); @@ -342,7 +342,7 @@ Container mapChannelResultsToContainer(const MappingData &mappingData, return r; } -QVariant buildPropertyValue(const MappingData &mappingData, const QList &channelResults) +QVariant buildPropertyValue(const MappingData &mappingData, const QVector &channelResults) { const int vectorOfFloatType = qMetaTypeId>(); @@ -410,8 +410,8 @@ QVariant buildPropertyValue(const MappingData &mappingData, const QList & } AnimationRecord prepareAnimationRecord(Qt3DCore::QNodeId animatorId, - const QList &mappingDataVec, - const QList &channelResults, + const QVector &mappingDataVec, + const QVector &channelResults, bool finalFrame, float normalizedLocalTime) { @@ -469,10 +469,10 @@ AnimationRecord prepareAnimationRecord(Qt3DCore::QNodeId animatorId, return record; } -QList prepareCallbacks(const QList &mappingDataVec, - const QList &channelResults) +QVector prepareCallbacks(const QVector &mappingDataVec, + const QVector &channelResults) { - QList callbacks; + QVector callbacks; for (const MappingData &mappingData : mappingDataVec) { if (!mappingData.callback) continue; @@ -492,10 +492,10 @@ QList prepareCallbacks(const QList &mapp // buildRequiredChannelsAndTypes() and assignChannelComponentIndices(). We are // currently repeating the iteration over mappings and extracting/generating // channel names, types and joint indices. -QList buildPropertyMappings(const QList &channelMappings, - const QList &channelNamesAndTypes, - const QList &channelComponentIndices, - const QList &sourceClipMask) +QVector buildPropertyMappings(const QVector &channelMappings, + const QVector &channelNamesAndTypes, + const QVector &channelComponentIndices, + const QVector &sourceClipMask) { // Accumulate the required number of mappings int maxMappingDatas = 0; @@ -513,7 +513,7 @@ QList buildPropertyMappings(const QList &channelMa } } } - QList mappingDataVec; + QVector mappingDataVec; mappingDataVec.reserve(maxMappingDatas); // Iterate over the mappings @@ -622,15 +622,15 @@ QList buildPropertyMappings(const QList &channelMa return mappingDataVec; } -QList buildRequiredChannelsAndTypes(Handler *handler, +QVector buildRequiredChannelsAndTypes(Handler *handler, const ChannelMapper *mapper) { ChannelMappingManager *mappingManager = handler->channelMappingManager(); - const QList mappingIds = mapper->mappingIds(); + const auto mappingIds = mapper->mappingIds(); // Reserve enough storage assuming each mapping is for a different channel. // May be overkill but avoids potential for multiple allocations - QList namesAndTypes; + QVector namesAndTypes; namesAndTypes.reserve(mappingIds.size()); // Iterate through the mappings and add ones not already used by an earlier mapping. @@ -690,9 +690,9 @@ QList buildRequiredChannelsAndTypes(Handler *handler, return namesAndTypes; } -QList assignChannelComponentIndices(const QList &namesAndTypes) +QVector assignChannelComponentIndices(const QVector &namesAndTypes) { - QList channelComponentIndices; + QVector channelComponentIndices; channelComponentIndices.reserve(namesAndTypes.size()); int baseIndex = 0; @@ -712,7 +712,7 @@ QList assignChannelComponentIndices(const QList gatherValueNodesToEvaluate(Handler *handler, +QVector gatherValueNodesToEvaluate(Handler *handler, Qt3DCore::QNodeId blendTreeRootId) { Q_ASSERT(handler); @@ -722,7 +722,7 @@ QList gatherValueNodesToEvaluate(Handler *handler, ClipBlendNodeManager *nodeManager = handler->clipBlendNodeManager(); // Visit the tree in a pre-order manner and collect the dependencies - QList clipIds; + QVector clipIds; ClipBlendNodeVisitor visitor(nodeManager, ClipBlendNodeVisitor::PreOrder, ClipBlendNodeVisitor::VisitOnlyDependencies); @@ -750,8 +750,8 @@ QList gatherValueNodesToEvaluate(Handler *handler, return clipIds; } -ClipFormat generateClipFormatIndices(const QList &targetChannels, - const QList &targetIndices, +ClipFormat generateClipFormatIndices(const QVector &targetChannels, + const QVector &targetIndices, const AnimationClip *clip) { Q_ASSERT(targetChannels.size() == targetIndices.size()); @@ -865,10 +865,10 @@ ClipResults evaluateBlendTree(Handler *handler, return blendTreeRootNode->clipResults(animatorId); } -QList defaultValueForChannel(Handler *handler, +QVector defaultValueForChannel(Handler *handler, const ChannelNameAndType &channelDescription) { - QList result; + QVector result; // Does the channel repesent a joint in a skeleton or is it a general channel? ChannelMappingManager *mappingManager = handler->channelMappingManager(); @@ -915,7 +915,7 @@ QList defaultValueForChannel(Handler *handler, // Everything else gets all zeros const int componentCount = mapping->componentCount(); - result = QList(componentCount, 0.0f); + result = QVector(componentCount, 0.0f); break; } @@ -924,7 +924,7 @@ QList defaultValueForChannel(Handler *handler, return result; } -void applyComponentDefaultValues(const QList &componentDefaults, +void applyComponentDefaultValues(const QVector &componentDefaults, ClipResults &formattedClipResults) { for (const auto &componentDefault : componentDefaults) diff --git a/src/animation/backend/animationutils_p.h b/src/animation/backend/animationutils_p.h index 63aaa1a37..bae9055bf 100644 --- a/src/animation/backend/animationutils_p.h +++ b/src/animation/backend/animationutils_p.h @@ -72,7 +72,7 @@ class AnimationClip; class ChannelMapper; class ChannelMapping; -using ComponentIndices = QList; +using ComponentIndices = QVector; enum JointTransformComponent { NoTransformComponent = 0, @@ -125,7 +125,7 @@ struct ClipEvaluationData bool isFinalFrame; }; -using ClipResults = QList; +using ClipResults = QVector; struct ChannelNameAndType { @@ -226,10 +226,10 @@ struct ClipFormat // formattedComponentIndices in flat vectors. This will require a // way to look up the offset and number of elements for each channel. ComponentIndices sourceClipIndices; - QList sourceClipMask; - QList formattedComponentIndices; - QList namesAndTypes; - QList defaultComponentValues; + QVector sourceClipMask; + QVector formattedComponentIndices; + QVector namesAndTypes; + QVector defaultComponentValues; }; #ifndef QT_NO_DEBUG_STREAM @@ -279,15 +279,15 @@ struct AnimationRecord { Qt3DCore::QNodeId animatorId; QList targetChanges; - QList>> skeletonChanges; + QList>> skeletonChanges; float normalizedTime = -1.f; bool finalFrame = false; }; Q_AUTOTEST_EXPORT AnimationRecord prepareAnimationRecord(Qt3DCore::QNodeId animatorId, - const QList &mappingDataVec, - const QList &channelResults, + const QVector &mappingDataVec, + const QVector &channelResults, bool finalFrame, float normalizedLocalTime); @@ -359,21 +359,21 @@ ClipResults evaluateClipAtPhase(AnimationClip *clip, float phase); Q_AUTOTEST_EXPORT -QList prepareCallbacks(const QList &mappingDataVec, - const QList &channelResults); +QVector prepareCallbacks(const QVector &mappingDataVec, + const QVector &channelResults); Q_AUTOTEST_EXPORT -QList buildPropertyMappings(const QList &channelMappings, - const QList &channelNamesAndTypes, - const QList &channelComponentIndices, - const QList &sourceClipMask); +QVector buildPropertyMappings(const QVector &channelMappings, + const QVector &channelNamesAndTypes, + const QVector &channelComponentIndices, + const QVector &sourceClipMask); Q_AUTOTEST_EXPORT -QList buildRequiredChannelsAndTypes(Handler *handler, - const ChannelMapper *mapper); +QVector buildRequiredChannelsAndTypes(Handler *handler, + const ChannelMapper *mapper); Q_AUTOTEST_EXPORT -QList assignChannelComponentIndices(const QList &namesAndTypes); +QVector assignChannelComponentIndices(const QVector &namesAndTypes); Q_AUTOTEST_EXPORT double localTimeFromElapsedTime(double t_current_local, double t_elapsed_global, @@ -386,12 +386,12 @@ double phaseFromElapsedTime(double t_current_local, double t_elapsed_global, int loopCount, int ¤tLoop); Q_AUTOTEST_EXPORT -QList gatherValueNodesToEvaluate(Handler *handler, +QVector gatherValueNodesToEvaluate(Handler *handler, Qt3DCore::QNodeId blendTreeRootId); Q_AUTOTEST_EXPORT -ClipFormat generateClipFormatIndices(const QList &targetChannels, - const QList &targetIndices, +ClipFormat generateClipFormatIndices(const QVector &targetChannels, + const QVector &targetIndices, const AnimationClip *clip); Q_AUTOTEST_EXPORT @@ -404,10 +404,10 @@ ClipResults evaluateBlendTree(Handler *handler, Qt3DCore::QNodeId blendNodeId); Q_AUTOTEST_EXPORT -QList defaultValueForChannel(Handler *handler, const ChannelNameAndType &channelDescription); +QVector defaultValueForChannel(Handler *handler, const ChannelNameAndType &channelDescription); Q_AUTOTEST_EXPORT -void applyComponentDefaultValues(const QList &componentDefaults, +void applyComponentDefaultValues(const QVector &componentDefaults, ClipResults &formattedClipResults); } // Animation diff --git a/src/animation/backend/blendedclipanimator_p.h b/src/animation/backend/blendedclipanimator_p.h index 795aa5b6a..2396cdd74 100644 --- a/src/animation/backend/blendedclipanimator_p.h +++ b/src/animation/backend/blendedclipanimator_p.h @@ -89,8 +89,8 @@ public: int currentLoop() const { return m_currentLoop; } void setCurrentLoop(int currentLoop) { m_currentLoop = currentLoop; } - void setMappingData(const QList &mappingData) { m_mappingData = mappingData; } - QList mappingData() const { return m_mappingData; } + void setMappingData(const QVector &mappingData) { m_mappingData = mappingData; } + QVector mappingData() const { return m_mappingData; } void animationClipMarkedDirty() { setDirty(Handler::BlendedClipAnimatorDirty); } @@ -123,7 +123,7 @@ private: float m_normalizedLocalTime; float m_lastNormalizedLocalTime; - QList m_mappingData; + QVector m_mappingData; }; } // namespace Animation diff --git a/src/animation/backend/buildblendtreesjob.cpp b/src/animation/backend/buildblendtreesjob.cpp index a9a6ce36c..0b4fc278a 100644 --- a/src/animation/backend/buildblendtreesjob.cpp +++ b/src/animation/backend/buildblendtreesjob.cpp @@ -55,7 +55,7 @@ BuildBlendTreesJob::BuildBlendTreesJob() SET_JOB_RUN_STAT_TYPE(this, JobTypes::BuildBlendTree, 0) } -void BuildBlendTreesJob::setBlendedClipAnimators(const QList &blendedClipAnimatorHandles) +void BuildBlendTreesJob::setBlendedClipAnimators(const QVector &blendedClipAnimatorHandles) { m_blendedClipAnimatorHandles = blendedClipAnimatorHandles; BlendedClipAnimatorManager *blendedClipAnimatorManager = m_handler->blendedClipAnimatorManager(); @@ -89,17 +89,17 @@ void BuildBlendTreesJob::run() const ChannelMapper *mapper = m_handler->channelMapperManager()->lookupResource(blendClipAnimator->mapperId()); if (!mapper) continue; - const QList channelNamesAndTypes + const QVector channelNamesAndTypes = buildRequiredChannelsAndTypes(m_handler, mapper); - const QList channelComponentIndices + const QVector channelComponentIndices = assignChannelComponentIndices(channelNamesAndTypes); // Find the leaf value nodes of the blend tree and for each of them // create a set of format indices that can later be used to map the // raw ClipResults resulting from evaluating an animation clip to the // layout used by the blend tree for this animator - QList blendTreeChannelMask; - const QList valueNodeIds + QVector blendTreeChannelMask; + const QVector valueNodeIds = gatherValueNodesToEvaluate(m_handler, blendClipAnimator->blendTreeRootId()); // Store the clip value nodes to avoid further lookups below. @@ -166,8 +166,8 @@ void BuildBlendTreesJob::run() // If we get to here then we need to obtain a default value // for this channel and store it for later application to any // missing components of this channel. - const QList defaultValue = defaultValueForChannel(m_handler, - f.namesAndTypes[i]); + const QVector defaultValue = defaultValueForChannel(m_handler, + f.namesAndTypes[i]); // Find the indices where we later need to inject these default // values and store them in the format. @@ -181,8 +181,8 @@ void BuildBlendTreesJob::run() // Finally, build the mapping data vector for this blended clip animator. This // gets used during the final stage of evaluation when sending the property changes // out to the targets of the animation. We do the costly work once up front. - const QList channelMappingIds = mapper->mappingIds(); - QList channelMappings; + const Qt3DCore::QNodeIdVector channelMappingIds = mapper->mappingIds(); + QVector channelMappings; channelMappings.reserve(channelMappingIds.size()); for (const auto &mappingId : channelMappingIds) { ChannelMapping *mapping = m_handler->channelMappingManager()->lookupResource(mappingId); @@ -190,11 +190,10 @@ void BuildBlendTreesJob::run() channelMappings.push_back(mapping); } - const QList mappingDataVec - = buildPropertyMappings(channelMappings, - channelNamesAndTypes, - channelComponentIndices, - blendTreeChannelMask); + const QVector mappingDataVec = buildPropertyMappings(channelMappings, + channelNamesAndTypes, + channelComponentIndices, + blendTreeChannelMask); blendClipAnimator->setMappingData(mappingDataVec); } } diff --git a/src/animation/backend/buildblendtreesjob_p.h b/src/animation/backend/buildblendtreesjob_p.h index c822e40f2..a14552cb9 100644 --- a/src/animation/backend/buildblendtreesjob_p.h +++ b/src/animation/backend/buildblendtreesjob_p.h @@ -66,13 +66,13 @@ public: void setHandler(Handler *handler) { m_handler = handler; } Handler *handler() const { return m_handler; } - void setBlendedClipAnimators(const QList &blendedClipAnimatorHandles); + void setBlendedClipAnimators(const QVector &blendedClipAnimatorHandles); protected: void run() override; private: - QList m_blendedClipAnimatorHandles; + QVector m_blendedClipAnimatorHandles; Handler *m_handler; }; diff --git a/src/animation/backend/channelmapper_p.h b/src/animation/backend/channelmapper_p.h index a2e9065a6..12b712719 100644 --- a/src/animation/backend/channelmapper_p.h +++ b/src/animation/backend/channelmapper_p.h @@ -71,10 +71,10 @@ public: void syncFromFrontEnd(const Qt3DCore::QNode *frontEnd, bool firstTime) override; - void setMappingIds(const QList &mappingIds) { m_mappingIds = mappingIds; } - QList mappingIds() const { return m_mappingIds; } + void setMappingIds(const Qt3DCore::QNodeIdVector &mappingIds) { m_mappingIds = mappingIds; } + Qt3DCore::QNodeIdVector mappingIds() const { return m_mappingIds; } - QList mappings() const + QVector mappings() const { if (m_isDirty) updateMappings(); @@ -84,10 +84,10 @@ public: private: void updateMappings() const; - QList m_mappingIds; + Qt3DCore::QNodeIdVector m_mappingIds; // Cached data - mutable QList m_mappings; + mutable QVector m_mappings; mutable bool m_isDirty; }; diff --git a/src/animation/backend/clipanimator_p.h b/src/animation/backend/clipanimator_p.h index 25e4af3d0..65fc6bdc8 100644 --- a/src/animation/backend/clipanimator_p.h +++ b/src/animation/backend/clipanimator_p.h @@ -85,8 +85,8 @@ public: // Called by jobs bool canRun() const { return !m_clipId.isNull() && !m_mapperId.isNull(); } - void setMappingData(const QList &mappingData) { m_mappingData = mappingData; } - QList mappingData() const { return m_mappingData; } + void setMappingData(const QVector &mappingData) { m_mappingData = mappingData; } + QVector mappingData() const { return m_mappingData; } void setStartTime(qint64 globalTime) { m_lastGlobalTimeNS = globalTime; } @@ -122,7 +122,7 @@ private: // Working state qint64 m_lastGlobalTimeNS; double m_lastLocalTime; - QList m_mappingData; + QVector m_mappingData; int m_currentLoop; ClipFormat m_clipFormat; diff --git a/src/animation/backend/evaluateblendclipanimatorjob.cpp b/src/animation/backend/evaluateblendclipanimatorjob.cpp index cfb2be1e0..294932eca 100644 --- a/src/animation/backend/evaluateblendclipanimatorjob.cpp +++ b/src/animation/backend/evaluateblendclipanimatorjob.cpp @@ -77,7 +77,7 @@ void EvaluateBlendClipAnimatorJob::run() } Qt3DCore::QNodeId blendTreeRootId = blendedClipAnimator->blendTreeRootId(); - const QList valueNodeIdsToEvaluate = gatherValueNodesToEvaluate(m_handler, blendTreeRootId); + const QVector valueNodeIdsToEvaluate = gatherValueNodesToEvaluate(m_handler, blendTreeRootId); // Calculate the resulting duration of the blend tree based upon its current state ClipBlendNodeManager *blendNodeManager = m_handler->clipBlendNodeManager(); @@ -129,7 +129,7 @@ void EvaluateBlendClipAnimatorJob::run() // Prepare the change record const bool finalFrame = isFinalFrame(localTime, duration, animatorData.currentLoop, animatorData.loopCount, animatorData.playbackRate); - const QList mappingData = blendedClipAnimator->mappingData(); + const QVector mappingData = blendedClipAnimator->mappingData(); auto record = prepareAnimationRecord(blendedClipAnimator->peerId(), mappingData, blendedResults, diff --git a/src/animation/backend/fcurve_p.h b/src/animation/backend/fcurve_p.h index 1a1b6dca6..71eebb763 100644 --- a/src/animation/backend/fcurve_p.h +++ b/src/animation/backend/fcurve_p.h @@ -149,7 +149,7 @@ struct Channel { QString name; int jointIndex = -1; - QList channelComponents; + QVector channelComponents; void read(const QJsonObject &json); void setFromQChannel(const QChannel &qch); diff --git a/src/animation/backend/findrunningclipanimatorsjob.cpp b/src/animation/backend/findrunningclipanimatorsjob.cpp index 4b75d9180..1005914c7 100644 --- a/src/animation/backend/findrunningclipanimatorsjob.cpp +++ b/src/animation/backend/findrunningclipanimatorsjob.cpp @@ -53,7 +53,7 @@ FindRunningClipAnimatorsJob::FindRunningClipAnimatorsJob() SET_JOB_RUN_STAT_TYPE(this, JobTypes::FindRunningClipAnimator, 0) } -void FindRunningClipAnimatorsJob::setDirtyClipAnimators(const QList &clipAnimatorHandles) +void FindRunningClipAnimatorsJob::setDirtyClipAnimators(const QVector &clipAnimatorHandles) { m_clipAnimatorHandles = clipAnimatorHandles; } @@ -85,11 +85,11 @@ void FindRunningClipAnimatorsJob::run() // blended clip animator for consistency and ease of maintenance. const ChannelMapper *mapper = m_handler->channelMapperManager()->lookupResource(clipAnimator->mapperId()); Q_ASSERT(mapper); - const QList channelMappings = mapper->mappings(); + const QVector channelMappings = mapper->mappings(); - const QList channelNamesAndTypes + const QVector channelNamesAndTypes = buildRequiredChannelsAndTypes(m_handler, mapper); - const QList channelComponentIndices + const QVector channelComponentIndices = assignChannelComponentIndices(channelNamesAndTypes); const AnimationClip *clip = m_handler->animationClipLoaderManager()->lookupResource(clipAnimator->clipId()); @@ -99,7 +99,7 @@ void FindRunningClipAnimatorsJob::run() clip); clipAnimator->setClipFormat(format); - const QList mappingData = buildPropertyMappings(channelMappings, + const QVector mappingData = buildPropertyMappings(channelMappings, channelNamesAndTypes, format.formattedComponentIndices, format.sourceClipMask); diff --git a/src/animation/backend/findrunningclipanimatorsjob_p.h b/src/animation/backend/findrunningclipanimatorsjob_p.h index f1d5d1701..ae2437ac8 100644 --- a/src/animation/backend/findrunningclipanimatorsjob_p.h +++ b/src/animation/backend/findrunningclipanimatorsjob_p.h @@ -71,13 +71,13 @@ public: void setHandler(Handler *handler) { m_handler = handler; } Handler *handler() const { return m_handler; } - void setDirtyClipAnimators(const QList &animationClipHandles); + void setDirtyClipAnimators(const QVector &animationClipHandles); protected: void run() override; private: - QList m_clipAnimatorHandles; + QVector m_clipAnimatorHandles; Handler *m_handler; #if defined(QT_BUILD_INTERNAL) diff --git a/src/animation/backend/gltfimporter.cpp b/src/animation/backend/gltfimporter.cpp index 910fd86fa..c4904ee9d 100644 --- a/src/animation/backend/gltfimporter.cpp +++ b/src/animation/backend/gltfimporter.cpp @@ -546,7 +546,7 @@ GLTFImporter::AnimationNameAndChannels GLTFImporter::createAnimationData(int ani // Get the key frame times first as these are common to all components of the // key frame values. const int keyFrameCount = inputAccessor.count; - QList keyframeTimes(keyFrameCount); + QVector keyframeTimes(keyFrameCount); for (int i = 0; i < keyFrameCount; ++i) { const auto rawTimestamp = accessorData(sampler.inputAccessorIndex, i); keyframeTimes[i] = *reinterpret_cast(rawTimestamp.data); diff --git a/src/animation/backend/gltfimporter_p.h b/src/animation/backend/gltfimporter_p.h index c4da7b40f..e9c2a3248 100644 --- a/src/animation/backend/gltfimporter_p.h +++ b/src/animation/backend/gltfimporter_p.h @@ -185,7 +185,7 @@ public: struct AnimationNameAndChannels { QString name; - QList channels; + QVector channels; }; AnimationNameAndChannels createAnimationData(int animationIndex, const QString &animationName = QString()) const; diff --git a/src/animation/backend/handler.cpp b/src/animation/backend/handler.cpp index ca0a971cc..d74138d91 100644 --- a/src/animation/backend/handler.cpp +++ b/src/animation/backend/handler.cpp @@ -146,7 +146,7 @@ void Handler::setBlendedClipAnimatorRunning(const HBlendedClipAnimator &handle, // The vectors may get outdated when the application removes/deletes an // animator component in the meantime. Recognize this. This should be // relatively infrequent so in most cases the vectors will not change at all. -void Handler::cleanupHandleList(QList *clips) +void Handler::cleanupHandleList(QVector *clips) { for (auto it = clips->begin(); it != clips->end(); ) { if (!m_animationClipLoaderManager->data(*it)) @@ -156,7 +156,7 @@ void Handler::cleanupHandleList(QList *clips) } } -void Handler::cleanupHandleList(QList *animators) +void Handler::cleanupHandleList(QVector *animators) { for (auto it = animators->begin(); it != animators->end(); ) { if (!m_clipAnimatorManager->data(*it)) @@ -166,7 +166,7 @@ void Handler::cleanupHandleList(QList *animators) } } -void Handler::cleanupHandleList(QList *animators) +void Handler::cleanupHandleList(QVector *animators) { for (auto it = animators->begin(); it != animators->end(); ) { if (!m_blendedClipAnimatorManager->data(*it)) @@ -218,7 +218,7 @@ std::vector Handler::jobsToExecute(qint64 time) // Rebuild blending trees if a blend tree is dirty const bool hasBuildBlendTreesJob = !m_dirtyBlendedAnimators.isEmpty(); if (hasBuildBlendTreesJob) { - const QList dirtyBlendedAnimators = std::move(m_dirtyBlendedAnimators); + const QVector dirtyBlendedAnimators = std::move(m_dirtyBlendedAnimators); m_buildBlendTreesJob->setBlendedClipAnimators(dirtyBlendedAnimators); jobs.push_back(m_buildBlendTreesJob); } diff --git a/src/animation/backend/handler_p.h b/src/animation/backend/handler_p.h index f565704b8..493f7f340 100644 --- a/src/animation/backend/handler_p.h +++ b/src/animation/backend/handler_p.h @@ -105,10 +105,10 @@ public: void setDirty(DirtyFlag flag, Qt3DCore::QNodeId nodeId); void setClipAnimatorRunning(const HClipAnimator &handle, bool running); - QList runningClipAnimators() const { return m_runningClipAnimators; } + QVector runningClipAnimators() const { return m_runningClipAnimators; } void setBlendedClipAnimatorRunning(const HBlendedClipAnimator &handle, bool running); - QList runningBlenndedClipAnimators() const { return m_runningBlendedClipAnimators; } + QVector runningBlenndedClipAnimators() const { return m_runningBlendedClipAnimators; } AnimationClipLoaderManager *animationClipLoaderManager() const noexcept { return m_animationClipLoaderManager.data(); } ClockManager *clockManager() const noexcept { return m_clockManager.data(); } @@ -121,9 +121,9 @@ public: std::vector jobsToExecute(qint64 time); - void cleanupHandleList(QList *clips); - void cleanupHandleList(QList *animators); - void cleanupHandleList(QList *animators); + void cleanupHandleList(QVector *clips); + void cleanupHandleList(QVector *animators); + void cleanupHandleList(QVector *animators); private: QMutex m_mutex; @@ -136,17 +136,17 @@ private: QScopedPointer m_clipBlendNodeManager; QScopedPointer m_skeletonManager; - QList m_dirtyAnimationClips; - QList m_dirtyClipAnimators; - QList m_dirtyBlendedAnimators; + QVector m_dirtyAnimationClips; + QVector m_dirtyClipAnimators; + QVector m_dirtyBlendedAnimators; - QList m_runningClipAnimators; - QList m_runningBlendedClipAnimators; + QVector m_runningClipAnimators; + QVector m_runningBlendedClipAnimators; QSharedPointer m_loadAnimationClipJob; QSharedPointer m_findRunningClipAnimatorsJob; - QList> m_evaluateClipAnimatorJobs; - QList m_evaluateBlendClipAnimatorJobs; + QVector> m_evaluateClipAnimatorJobs; + QVector m_evaluateBlendClipAnimatorJobs; BuildBlendTreesJobPtr m_buildBlendTreesJob; qint64 m_simulationTime; diff --git a/src/animation/backend/loadanimationclipjob.cpp b/src/animation/backend/loadanimationclipjob.cpp index fd8f620a8..331b99b36 100644 --- a/src/animation/backend/loadanimationclipjob.cpp +++ b/src/animation/backend/loadanimationclipjob.cpp @@ -69,7 +69,7 @@ LoadAnimationClipJob::LoadAnimationClipJob() SET_JOB_RUN_STAT_TYPE(this, JobTypes::LoadAnimationClip, 0) } -void LoadAnimationClipJob::addDirtyAnimationClips(const QList &animationClipHandles) +void LoadAnimationClipJob::addDirtyAnimationClips(const QVector &animationClipHandles) { for (const auto &handle : animationClipHandles) { if (!m_animationClipHandles.contains(handle)) diff --git a/src/animation/backend/loadanimationclipjob_p.h b/src/animation/backend/loadanimationclipjob_p.h index bbe67f20e..2c148f08d 100644 --- a/src/animation/backend/loadanimationclipjob_p.h +++ b/src/animation/backend/loadanimationclipjob_p.h @@ -69,7 +69,7 @@ public: void setHandler(Handler *handler) { m_handler = handler; } Handler *handler() const { return m_handler; } - void addDirtyAnimationClips(const QList &animationClipHandles); + void addDirtyAnimationClips(const QVector &animationClipHandles); void clearDirtyAnimationClips(); protected: @@ -78,7 +78,7 @@ protected: private: Q_DECLARE_PRIVATE(LoadAnimationClipJob) - QList m_animationClipHandles; + QVector m_animationClipHandles; Handler *m_handler; }; diff --git a/src/animation/backend/skeleton_p.h b/src/animation/backend/skeleton_p.h index a184921dd..d44f8fc1c 100644 --- a/src/animation/backend/skeleton_p.h +++ b/src/animation/backend/skeleton_p.h @@ -64,7 +64,7 @@ public: void cleanup(); void syncFromFrontEnd(const Qt3DCore::QNode *frontEnd, bool firstTime) override; - QList joints() const { return m_jointLocalPoses; } + QVector joints() const { return m_jointLocalPoses; } int jointCount() const { return m_jointLocalPoses.size(); } QString jointName(int jointIndex) const { return m_jointNames.at(jointIndex); } @@ -104,15 +104,15 @@ public: m_jointNames.resize(jointCount); m_jointLocalPoses.resize(jointCount); } - void setJointNames(const QList &names) { m_jointNames = names; } - QList jointNames() const { return m_jointNames; } - void setJointLocalPoses(const QList &localPoses) { m_jointLocalPoses = localPoses; } - QList jointLocalPoses() const { return m_jointLocalPoses; } + void setJointNames(const QVector &names) { m_jointNames = names; } + QVector jointNames() const { return m_jointNames; } + void setJointLocalPoses(const QVector &localPoses) { m_jointLocalPoses = localPoses; } + QVector jointLocalPoses() const { return m_jointLocalPoses; } #endif private: - QList m_jointNames; - QList m_jointLocalPoses; + QVector m_jointNames; + QVector m_jointLocalPoses; }; } // namespace Animation diff --git a/src/animation/frontend/qanimationclipdata.cpp b/src/animation/frontend/qanimationclipdata.cpp index 41ebe68ef..f68748515 100644 --- a/src/animation/frontend/qanimationclipdata.cpp +++ b/src/animation/frontend/qanimationclipdata.cpp @@ -48,7 +48,7 @@ namespace Qt3DAnimation { class QAnimationClipDataPrivate { public: - QList m_channels; + QVector m_channels; QString m_name; }; diff --git a/src/animation/frontend/qchannel.cpp b/src/animation/frontend/qchannel.cpp index 8012f1b5c..0e944dd6e 100644 --- a/src/animation/frontend/qchannel.cpp +++ b/src/animation/frontend/qchannel.cpp @@ -48,7 +48,7 @@ namespace Qt3DAnimation { class QChannelPrivate { public: - QList m_channelComponents; + QVector m_channelComponents; QString m_name; int m_jointIndex = -1; }; diff --git a/src/animation/frontend/qchannelcomponent.cpp b/src/animation/frontend/qchannelcomponent.cpp index 755ed6294..e5a19f93d 100644 --- a/src/animation/frontend/qchannelcomponent.cpp +++ b/src/animation/frontend/qchannelcomponent.cpp @@ -48,7 +48,7 @@ namespace Qt3DAnimation { class QChannelComponentPrivate { public: - QList m_keyFrames; + QVector m_keyFrames; QString m_name; }; diff --git a/src/animation/frontend/qmorphinganimation.cpp b/src/animation/frontend/qmorphinganimation.cpp index 63c0d68ca..96ea346bb 100644 --- a/src/animation/frontend/qmorphinganimation.cpp +++ b/src/animation/frontend/qmorphinganimation.cpp @@ -179,7 +179,7 @@ QMorphingAnimationPrivate::QMorphingAnimationPrivate() QMorphingAnimationPrivate::~QMorphingAnimationPrivate() { - for (QList *weights : qAsConst(m_weights)) + for (QVector *weights : qAsConst(m_weights)) delete weights; } @@ -189,7 +189,7 @@ void QMorphingAnimationPrivate::updateAnimation(float position) if (!m_target || !m_target->geometry()) return; - QList relevantValues; + QVector relevantValues; float sum = 0.0f; float interpolator = 0.0f; m_morphKey.resize(m_morphTargets.size()); @@ -282,7 +282,7 @@ QMorphingAnimation::QMorphingAnimation(QObject *parent) this, &QMorphingAnimation::updateAnimation); } -QList QMorphingAnimation::targetPositions() const +QVector QMorphingAnimation::targetPositions() const { Q_D(const QMorphingAnimation); return d->m_targetPositions; @@ -321,7 +321,7 @@ QEasingCurve QMorphingAnimation::easing() const /*! Set morph \a targets to animation. Old targets are cleared. */ -void QMorphingAnimation::setMorphTargets(const QList &targets) +void QMorphingAnimation::setMorphTargets(const QVector &targets) { Q_D(QMorphingAnimation); d->m_morphTargets = targets; @@ -353,7 +353,7 @@ void QMorphingAnimation::removeMorphTarget(Qt3DAnimation::QMorphTarget *target) d->m_position = -1.0f; } -void QMorphingAnimation::setTargetPositions(const QList &targetPositions) +void QMorphingAnimation::setTargetPositions(const QVector &targetPositions) { Q_D(QMorphingAnimation); d->m_targetPositions = targetPositions; @@ -365,7 +365,7 @@ void QMorphingAnimation::setTargetPositions(const QList &targetPositions) d->m_weights.resize(targetPositions.size()); for (int i = 0; i < d->m_weights.size(); ++i) { if (d->m_weights[i] == nullptr) - d->m_weights[i] = new QList(); + d->m_weights[i] = new QVector(); } } d->m_position = -1.0f; @@ -384,13 +384,13 @@ void QMorphingAnimation::setTarget(Qt3DRender::QGeometryRenderer *target) /*! Sets morph \a weights at \a positionIndex. */ -void QMorphingAnimation::setWeights(int positionIndex, const QList &weights) +void QMorphingAnimation::setWeights(int positionIndex, const QVector &weights) { Q_D(QMorphingAnimation); if (d->m_weights.size() < positionIndex) d->m_weights.resize(positionIndex + 1); if (d->m_weights[positionIndex] == nullptr) - d->m_weights[positionIndex] = new QList(); + d->m_weights[positionIndex] = new QVector(); *d->m_weights[positionIndex] = weights; d->m_position = -1.0f; } @@ -398,7 +398,7 @@ void QMorphingAnimation::setWeights(int positionIndex, const QList &weigh /*! Return morph weights at \a positionIndex. */ -QList QMorphingAnimation::getWeights(int positionIndex) +QVector QMorphingAnimation::getWeights(int positionIndex) { Q_D(QMorphingAnimation); return *d->m_weights[positionIndex]; @@ -407,7 +407,7 @@ QList QMorphingAnimation::getWeights(int positionIndex) /*! Return morph target list. */ -QList QMorphingAnimation::morphTargetList() +QVector QMorphingAnimation::morphTargetList() { Q_D(QMorphingAnimation); return d->m_morphTargets; diff --git a/src/animation/frontend/qmorphinganimation.h b/src/animation/frontend/qmorphinganimation.h index fab6f5b44..1a9a60695 100644 --- a/src/animation/frontend/qmorphinganimation.h +++ b/src/animation/frontend/qmorphinganimation.h @@ -54,7 +54,7 @@ class QMorphingAnimationPrivate; class Q_3DANIMATIONSHARED_EXPORT QMorphingAnimation : public QAbstractAnimation { Q_OBJECT - Q_PROPERTY(QList targetPositions READ targetPositions WRITE setTargetPositions NOTIFY targetPositionsChanged) + Q_PROPERTY(QVector targetPositions READ targetPositions WRITE setTargetPositions NOTIFY targetPositionsChanged) Q_PROPERTY(float interpolator READ interpolator NOTIFY interpolatorChanged) Q_PROPERTY(Qt3DRender::QGeometryRenderer *target READ target WRITE setTarget NOTIFY targetChanged) Q_PROPERTY(QString targetName READ targetName WRITE setTargetName NOTIFY targetNameChanged) @@ -71,31 +71,31 @@ public: explicit QMorphingAnimation(QObject *parent = nullptr); - QList targetPositions() const; + QVector targetPositions() const; float interpolator() const; Qt3DRender::QGeometryRenderer *target() const; QString targetName() const; QMorphingAnimation::Method method() const; QEasingCurve easing() const; - void setMorphTargets(const QList &targets); + void setMorphTargets(const QVector &targets); void addMorphTarget(Qt3DAnimation::QMorphTarget *target); void removeMorphTarget(Qt3DAnimation::QMorphTarget *target); - void setWeights(int positionIndex, const QList &weights); - QList getWeights(int positionIndex); + void setWeights(int positionIndex, const QVector &weights); + QVector getWeights(int positionIndex); - QList morphTargetList(); + QVector morphTargetList(); public Q_SLOTS: - void setTargetPositions(const QList &targetPositions); + void setTargetPositions(const QVector &targetPositions); void setTarget(Qt3DRender::QGeometryRenderer *target); void setTargetName(const QString name); void setMethod(QMorphingAnimation::Method method); void setEasing(const QEasingCurve &easing); Q_SIGNALS: - void targetPositionsChanged(const QList &targetPositions); + void targetPositionsChanged(const QVector &targetPositions); void interpolatorChanged(float interpolator); void targetChanged(Qt3DRender::QGeometryRenderer *target); void targetNameChanged(const QString &name); diff --git a/src/animation/frontend/qmorphinganimation_p.h b/src/animation/frontend/qmorphinganimation_p.h index 5c501ef8d..c306f3309 100644 --- a/src/animation/frontend/qmorphinganimation_p.h +++ b/src/animation/frontend/qmorphinganimation_p.h @@ -69,11 +69,11 @@ public: float m_minposition; float m_maxposition; - QList m_targetPositions; - QList*> m_weights; - QList m_morphKey; + QVector m_targetPositions; + QVector*> m_weights; + QVector m_morphKey; QStringList m_attributeNames; - QList m_morphTargets; + QVector m_morphTargets; QMorphTarget *m_flattened; QMorphingAnimation::Method m_method; QEasingCurve m_easing; diff --git a/src/core/resources/qframeallocator_p_p.h b/src/core/resources/qframeallocator_p_p.h index daf204f22..bf4e0a2b1 100644 --- a/src/core/resources/qframeallocator_p_p.h +++ b/src/core/resources/qframeallocator_p_p.h @@ -101,7 +101,7 @@ private: private: uint m_blockSize; uchar m_nbrBlock; - QList m_chunks; + QVector m_chunks; QFrameChunk *m_lastAllocatedChunck; QFrameChunk *m_lastFreedChunck; }; @@ -128,7 +128,7 @@ public: uint m_maxObjectSize; uint m_alignment; - QList m_allocatorPool; + QVector m_allocatorPool; }; } // Qt3D diff --git a/src/core/transforms/qabstractskeleton_p.h b/src/core/transforms/qabstractskeleton_p.h index 01d8fc74e..333fa5fdf 100644 --- a/src/core/transforms/qabstractskeleton_p.h +++ b/src/core/transforms/qabstractskeleton_p.h @@ -78,8 +78,8 @@ public: SkeletonType m_type; int m_jointCount; - QList m_localPoses; - QList m_jointNames; + QVector m_localPoses; + QVector m_jointNames; }; } // namespace Qt3DCore diff --git a/src/extras/3dtext/qextrudedtextgeometry.cpp b/src/extras/3dtext/qextrudedtextgeometry.cpp index 2f63f2175..a11b91fa6 100644 --- a/src/extras/3dtext/qextrudedtextgeometry.cpp +++ b/src/extras/3dtext/qextrudedtextgeometry.cpp @@ -75,10 +75,10 @@ struct TriangulationData { int end; }; - QList vertices; - QList indices; - QList outlines; - QList outlineIndices; + QVector vertices; + QVector indices; + QVector outlines; + QVector outlineIndices; bool inverted; }; @@ -107,7 +107,7 @@ TriangulationData triangulate(const QString &text, const QFont &font) // Extract polylines out of the path, this allows us to retrieve indices for each glyph outline QPolylineSet polylines = qPolyline(path); - QList tmpIndices; + QVector tmpIndices; tmpIndices.resize(polylines.indices.size()); memcpy(tmpIndices.data(), polylines.indices.data(), polylines.indices.size() * sizeof(IndexType)); @@ -315,8 +315,8 @@ void QExtrudedTextGeometryPrivate::update() QVector3D normal; }; - QList indices; - QList vertices; + QVector indices; + QVector vertices; // TODO: keep 'vertices.size()' small when extruding vertices.reserve(data.vertices.size() * 2); diff --git a/src/extras/text/distancefieldtextrenderer.cpp b/src/extras/text/distancefieldtextrenderer.cpp index 6fcb867db..af4840a36 100644 --- a/src/extras/text/distancefieldtextrenderer.cpp +++ b/src/extras/text/distancefieldtextrenderer.cpp @@ -129,8 +129,8 @@ DistanceFieldTextRenderer::~DistanceFieldTextRenderer() } void DistanceFieldTextRenderer::setGlyphData(Qt3DRender::QAbstractTexture *glyphTexture, - const QList &vertexData, - const QList &indexData) + const QVector &vertexData, + const QVector &indexData) { Q_D(DistanceFieldTextRenderer); diff --git a/src/extras/text/distancefieldtextrenderer_p.h b/src/extras/text/distancefieldtextrenderer_p.h index 0d71abc3b..fdb9a836f 100644 --- a/src/extras/text/distancefieldtextrenderer_p.h +++ b/src/extras/text/distancefieldtextrenderer_p.h @@ -75,8 +75,8 @@ public: ~DistanceFieldTextRenderer(); void setGlyphData(Qt3DRender::QAbstractTexture *glyphTexture, - const QList &vertexData, - const QList &indexData); + const QVector &vertexData, + const QVector &indexData); void setColor(const QColor &color); diff --git a/src/extras/text/qdistancefieldglyphcache.cpp b/src/extras/text/qdistancefieldglyphcache.cpp index f1c2bd3e0..d367410c8 100644 --- a/src/extras/text/qdistancefieldglyphcache.cpp +++ b/src/extras/text/qdistancefieldglyphcache.cpp @@ -341,7 +341,7 @@ QList QDistanceFieldGlyphCache::refGlyphs(const DistanceFieldFont *dff = getOrCreateDistanceFieldFont(run.rawFont()); QList ret; - const QList glyphs = run.glyphIndexes(); + const auto glyphs = run.glyphIndexes(); for (quint32 glyph : glyphs) ret << refAndGetGlyph(dff, glyph); @@ -357,7 +357,7 @@ void QDistanceFieldGlyphCache::derefGlyphs(const QGlyphRun &run) { DistanceFieldFont *dff = getOrCreateDistanceFieldFont(run.rawFont()); - const QList glyphs = run.glyphIndexes(); + const auto glyphs = run.glyphIndexes(); for (quint32 glyph : glyphs) dff->derefGlyph(glyph); } diff --git a/src/extras/text/qtext2dentity.cpp b/src/extras/text/qtext2dentity.cpp index b373cf2f7..28e0bb770 100644 --- a/src/extras/text/qtext2dentity.cpp +++ b/src/extras/text/qtext2dentity.cpp @@ -211,8 +211,8 @@ float QText2DEntityPrivate::computeActualScale() const struct RenderData { int vertexCount = 0; - QList vertex; - QList index; + QVector vertex; + QVector index; }; void QText2DEntityPrivate::setCurrentGlyphRuns(const QList &runs) @@ -224,8 +224,8 @@ void QText2DEntityPrivate::setCurrentGlyphRuns(const QList &runs) // process glyph runs for (const QGlyphRun &run : runs) { - const QList glyphs = run.glyphIndexes(); - const QList pos = run.positions(); + const auto glyphs = run.glyphIndexes(); + const auto pos = run.positions(); Q_ASSERT(glyphs.size() == pos.size()); diff --git a/src/input/backend/movingaverage_p.h b/src/input/backend/movingaverage_p.h index b2c85654b..67b2ec559 100644 --- a/src/input/backend/movingaverage_p.h +++ b/src/input/backend/movingaverage_p.h @@ -73,7 +73,7 @@ private: unsigned int m_sampleCount; unsigned int m_currentSample; float m_total; - QList m_samples; + QVector m_samples; }; } // Input diff --git a/src/plugins/sceneparsers/gltf/gltfimporter.cpp b/src/plugins/sceneparsers/gltf/gltfimporter.cpp index 6cf84f89e..7588eb517 100644 --- a/src/plugins/sceneparsers/gltf/gltfimporter.cpp +++ b/src/plugins/sceneparsers/gltf/gltfimporter.cpp @@ -2134,8 +2134,8 @@ QVariant GLTFImporter::parameterValueFromJSON(int type, const QJsonValue &value) QVector2D vector2D; QVector3D vector3D; QVector4D vector4D; - QList dataMat2(4, 0.0f); - QList dataMat3(9, 0.0f); + QVector dataMat2(4, 0.0f); + QVector dataMat3(9, 0.0f); switch (type) { case GL_BYTE: diff --git a/src/plugins/sceneparsers/gltfexport/gltfexporter.cpp b/src/plugins/sceneparsers/gltfexport/gltfexporter.cpp index 664ac39ae..6847b4897 100644 --- a/src/plugins/sceneparsers/gltfexport/gltfexporter.cpp +++ b/src/plugins/sceneparsers/gltfexport/gltfexporter.cpp @@ -132,7 +132,7 @@ inline QJsonArray col2jsvec(const QColor &color, bool alpha = false) } template -inline QJsonArray vec2jsvec(const QList &v) +inline QJsonArray vec2jsvec(const QVector &v) { QJsonArray arr; for (int i = 0; i < v.count(); ++i) diff --git a/src/plugins/sceneparsers/gltfexport/gltfexporter.h b/src/plugins/sceneparsers/gltfexport/gltfexporter.h index dfa180ee4..3eeaa000f 100644 --- a/src/plugins/sceneparsers/gltfexport/gltfexporter.h +++ b/src/plugins/sceneparsers/gltfexport/gltfexporter.h @@ -161,8 +161,8 @@ private: QHash colors; QHash textures; QHash values; - QList blendArguments; - QList blendEquations; + QVector blendArguments; + QVector blendEquations; }; struct ProgramInfo { diff --git a/src/render/backend/uniform.cpp b/src/render/backend/uniform.cpp index 92fb077f7..193f92080 100644 --- a/src/render/backend/uniform.cpp +++ b/src/render/backend/uniform.cpp @@ -277,7 +277,7 @@ UniformValue UniformValue::fromVariant(const QVariant &variant) } template<> -void UniformValue::setData(const QList &v) +void UniformValue::setData(const QVector &v) { m_data.resize(16 * v.size()); m_valueType = ScalarValue; diff --git a/src/render/backend/uniform_p.h b/src/render/backend/uniform_p.h index b1ddcf01c..24bbcd76c 100644 --- a/src/render/backend/uniform_p.h +++ b/src/render/backend/uniform_p.h @@ -162,7 +162,7 @@ public: } #endif - UniformValue(const QList &v) + UniformValue(const QVector &v) : m_data(16 * v.size()) { int offset = 0; @@ -193,7 +193,7 @@ public: UniformType storedType() const { return m_storedType; } template - void setData(const QList &v) + void setData(const QVector &v) { m_elementByteSize = sizeof(T); m_data.resize(v.size() * sizeof(T) / sizeof(float)); @@ -242,7 +242,7 @@ private: }; template<> -Q_3DRENDERSHARED_PRIVATE_EXPORT void UniformValue::setData(const QList &v); +Q_3DRENDERSHARED_PRIVATE_EXPORT void UniformValue::setData(const QVector &v); } // namespace Render } // namespace Qt3DRender diff --git a/src/render/geometry/gltfskeletonloader_p.h b/src/render/geometry/gltfskeletonloader_p.h index 025c632ed..c52c71951 100644 --- a/src/render/geometry/gltfskeletonloader_p.h +++ b/src/render/geometry/gltfskeletonloader_p.h @@ -170,11 +170,11 @@ private: QJsonDocument m_json; QString m_basePath; - QList m_bufferDatas; - QList m_bufferViews; - QList m_accessors; - QList m_skins; - QList m_nodes; + QVector m_bufferDatas; + QVector m_bufferViews; + QVector m_accessors; + QVector m_skins; + QVector m_nodes; }; } // namespace Render diff --git a/src/render/geometry/skeleton.cpp b/src/render/geometry/skeleton.cpp index 8a3aeccc8..828382cd0 100644 --- a/src/render/geometry/skeleton.cpp +++ b/src/render/geometry/skeleton.cpp @@ -171,10 +171,10 @@ void Skeleton::setLocalPose(HJoint jointHandle, const Qt3DCore::Sqt &localPose) m_skeletonData.localPoses[jointIndex] = localPose; } -QList Skeleton::calculateSkinningMatrixPalette() +QVector Skeleton::calculateSkinningMatrixPalette() { - const QList &localPoses = m_skeletonData.localPoses; - QList &joints = m_skeletonData.joints; + const QVector &localPoses = m_skeletonData.localPoses; + QVector &joints = m_skeletonData.joints; for (int i = 0; i < m_skeletonData.joints.size(); ++i) { // Calculate the global pose of this joint JointInfo &joint = joints[i]; diff --git a/src/render/geometry/skeleton_p.h b/src/render/geometry/skeleton_p.h index 93e72ec77..4c6c038c7 100644 --- a/src/render/geometry/skeleton_p.h +++ b/src/render/geometry/skeleton_p.h @@ -102,15 +102,15 @@ public: QString name() const { return m_name; } int jointCount() const { return m_skeletonData.joints.size(); } - QList joints() const { return m_skeletonData.joints; } - QList jointNames() const { return m_skeletonData.jointNames; } - QList localPoses() const { return m_skeletonData.localPoses; } + QVector joints() const { return m_skeletonData.joints; } + QVector jointNames() const { return m_skeletonData.jointNames; } + QVector localPoses() const { return m_skeletonData.localPoses; } Qt3DCore::QNodeId rootJointId() const { return m_rootJointId; } // Called from jobs void setLocalPose(HJoint jointHandle, const Qt3DCore::Sqt &localPose); - QList calculateSkinningMatrixPalette(); + QVector calculateSkinningMatrixPalette(); void clearData(); void setSkeletonData(const SkeletonData &data); @@ -124,7 +124,7 @@ public: #endif private: - QList m_skinningPalette; + QVector m_skinningPalette; // QSkeletonLoader Properties QUrl m_source; diff --git a/src/render/geometry/skeletondata_p.h b/src/render/geometry/skeletondata_p.h index 7106c0d4d..70a6f650d 100644 --- a/src/render/geometry/skeletondata_p.h +++ b/src/render/geometry/skeletondata_p.h @@ -86,9 +86,9 @@ struct Q_AUTOTEST_EXPORT SkeletonData void reserve(int size); - QList joints; - QList localPoses; - QList jointNames; + QVector joints; + QVector localPoses; + QVector jointNames; QHash jointIndices; }; diff --git a/src/render/jobs/updateskinningpalettejob.cpp b/src/render/jobs/updateskinningpalettejob.cpp index 1277cee79..51a3bb030 100644 --- a/src/render/jobs/updateskinningpalettejob.cpp +++ b/src/render/jobs/updateskinningpalettejob.cpp @@ -95,7 +95,7 @@ void UpdateSkinningPaletteJob::run() auto skeleton = skeletonManager->lookupResource(skeletonId); Q_ASSERT(skeleton); - const QList skinningPalette = skeleton->calculateSkinningMatrixPalette(); + const QVector &skinningPalette = skeleton->calculateSkinningMatrixPalette(); armature->skinningPaletteUniform().setData(skinningPalette); } } 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) +Q_DECLARE_METATYPE(QVector) Q_DECLARE_METATYPE(Clock *) Q_DECLARE_METATYPE(ChannelMapper *) Q_DECLARE_METATYPE(AnimationClip *) -Q_DECLARE_METATYPE(QList) +Q_DECLARE_METATYPE(QVector) Q_DECLARE_METATYPE(Channel) Q_DECLARE_METATYPE(AnimatorEvaluationData) Q_DECLARE_METATYPE(ClipEvaluationData) Q_DECLARE_METATYPE(ClipAnimator *) Q_DECLARE_METATYPE(BlendedClipAnimator *) -Q_DECLARE_METATYPE(QList) -Q_DECLARE_METATYPE(QList) +Q_DECLARE_METATYPE(QVector) +Q_DECLARE_METATYPE(QVector) Q_DECLARE_METATYPE(ClipFormat) Q_DECLARE_METATYPE(ChannelNameAndType) @@ -275,11 +275,11 @@ private Q_SLOTS: void checkBuildPropertyMappings_data() { QTest::addColumn("handler"); - QTest::addColumn>("channelMappings"); - QTest::addColumn>("channelNamesAndTypes"); - QTest::addColumn>("channelComponentIndices"); - QTest::addColumn>("sourceClipMask"); - QTest::addColumn>("expectedResults"); + QTest::addColumn>("channelMappings"); + QTest::addColumn>("channelNamesAndTypes"); + QTest::addColumn>("channelComponentIndices"); + QTest::addColumn>("sourceClipMask"); + QTest::addColumn>("expectedResults"); // Single ChannelMapping { @@ -292,7 +292,7 @@ private Q_SLOTS: static_cast(QMetaType::QVector3D), 3); - const QList channelMappings = { channelMapping }; + const QVector 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>(), + qMetaTypeId>(), 6, channelMapping->peerId() }; const ChannelNameAndType rgbColor = { QLatin1String("rgbColor"), @@ -332,7 +332,7 @@ private Q_SLOTS: 4, channelMapping->peerId() }; - const QList channelNamesAndTypes + const QVector 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 channelComponentIndices + const QVector channelComponentIndices = { rotationIndices, locationIndices, baseColorIndices, metalnessIndices, roughnessIndices, morphTargetListIndices, morphTargetVecIndices, rgbColorIndices, rgbaColorIndices }; - const QList 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 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 expectedResults = { expectedMapping }; + const QVector expectedResults = { expectedMapping }; QTest::newRow("single mapping") << handler @@ -424,7 +424,7 @@ private Q_SLOTS: 5); - const QList channelMappings + const QVector channelMappings = { locationMapping, metalnessMapping, baseColorMapping, roughnessMapping, rotationMapping, morphTargetMapping }; @@ -454,7 +454,7 @@ private Q_SLOTS: static_cast(QMetaType::QVariantList), 5, morphTargetMapping->peerId() }; - const QList channelNamesAndTypes + const QVector 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 channelComponentIndices + const QVector channelComponentIndices = { rotationIndices, locationIndices, baseColorIndices, metalnessIndices, roughnessIndices, morphTargetIndices }; - const QList sourceClipMask = { QBitArray(4, true), - QBitArray(3, true), - QBitArray(3, true), - QBitArray(1, true), - QBitArray(1, true), - QBitArray(5, true) }; + const QVector 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 expectedResults + const QVector expectedResults = { expectedLocationMapping, expectedMetalnessMapping, expectedBaseColorMapping, @@ -536,10 +536,10 @@ private Q_SLOTS: auto skeleton = createSkeleton(handler, jointCount); auto channelMapping = createChannelMapping(handler, skeleton->peerId()); - const QList channelMappings = { channelMapping }; + const QVector channelMappings = { channelMapping }; // Create a few channels in the format description - QList channelNamesAndTypes; + QVector channelNamesAndTypes; for (int i = 0; i < jointCount; ++i) { ChannelNameAndType locationDescription = { QLatin1String("Location"), static_cast(QMetaType::QVector3D), @@ -567,27 +567,27 @@ private Q_SLOTS: } // And the matching indices - const QList channelComponentIndices = { + const QVector 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 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 expectedResults; + const QVector 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 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, channelMappings); - QFETCH(QList, channelNamesAndTypes); - QFETCH(QList, channelComponentIndices); - QFETCH(QList, sourceClipMask); - QFETCH(QList, expectedResults); + QFETCH(QVector, channelMappings); + QFETCH(QVector, channelNamesAndTypes); + QFETCH(QVector, channelComponentIndices); + QFETCH(QVector, sourceClipMask); + QFETCH(QVector, expectedResults); // WHEN - const QList 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("animatorId"); - QTest::addColumn>("mappingData"); - QTest::addColumn>("channelResults"); + QTest::addColumn>("mappingData"); + QTest::addColumn>("channelResults"); QTest::addColumn("expectedChanges"); Qt3DCore::QNodeId animatorId; - QList mappingData; - QList channelResults; + QVector mappingData; + QVector 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(QMetaType::QVector3D); - mapping.channelIndices = QList { 0, 1, 2 }; + mapping.channelIndices = QVector { 0, 1, 2 }; mappingData.push_back(mapping); - channelResults = QList { 1.0f, 2.0f, 3.0f }; + channelResults = QVector { 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(QMetaType::QVector3D); - translationMapping.channelIndices = QList { 0, 1, 2 }; + translationMapping.channelIndices = QVector { 0, 1, 2 }; mappingData.push_back(translationMapping); MappingData scaleMapping; scaleMapping.targetId = Qt3DCore::QNodeId::createId(); scaleMapping.propertyName = "scale"; scaleMapping.type = static_cast(QMetaType::QVector3D); - scaleMapping.channelIndices = QList { 3, 4, 5 }; + scaleMapping.channelIndices = QVector { 3, 4, 5 }; mappingData.push_back(scaleMapping); - channelResults = QList { 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f }; + channelResults = QVector { 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(QMetaType::Double); - mapping.channelIndices = QList { 0 }; + mapping.channelIndices = QVector { 0 }; mappingData.push_back(mapping); - channelResults = QList { 3.5f }; + channelResults = QVector { 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(QMetaType::QVector2D); - mapping.channelIndices = QList { 0, 1 }; + mapping.channelIndices = QVector { 0, 1 }; mappingData.push_back(mapping); - channelResults = QList { 2.0f, 1.0f }; + channelResults = QVector { 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(QMetaType::QVector4D); - mapping.channelIndices = QList { 0, 1, 2, 3 }; + mapping.channelIndices = QVector { 0, 1, 2, 3 }; mappingData.push_back(mapping); - channelResults = QList { 4.0f, 3.0f, 2.0f, 1.0f }; + channelResults = QVector { 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(QMetaType::QQuaternion); - mapping.channelIndices = QList { 0, 1, 2, 3 }; + mapping.channelIndices = QVector { 0, 1, 2, 3 }; mappingData.push_back(mapping); - channelResults = QList { 1.0f, 0.0f, 0.0f, 1.0f }; + channelResults = QVector { 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(QMetaType::QColor); - mapping.channelIndices = QList { 0, 1, 2 }; + mapping.channelIndices = QVector { 0, 1, 2 }; mappingData.push_back(mapping); - channelResults = QList { 0.5f, 0.4f, 0.3f }; + channelResults = QVector { 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(QMetaType::QColor); - mapping.channelIndices = QList { 0, 1, 2, 3 }; + mapping.channelIndices = QVector { 0, 1, 2, 3 }; mappingData.push_back(mapping); - channelResults = QList { 0.5f, 0.4f, 0.3f, 0.2f }; + channelResults = QVector { 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(QMetaType::QVariantList); - mapping.channelIndices = QList { 0, 1, 2, 3, 4, 5, 6 }; + mapping.channelIndices = QVector { 0, 1, 2, 3, 4, 5, 6 }; mappingData.push_back(mapping); - channelResults = QList { 0.5f, 0.4f, 0.3f, 0.0f, 1.0f, 0.6f, 0.9f }; + channelResults = QVector { 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); - QFETCH(QList, channelResults); + QFETCH(QVector, mappingData); + QFETCH(QVector, channelResults); QFETCH(AnimationRecord, expectedChanges); // WHEN @@ -1052,13 +1052,13 @@ private Q_SLOTS: void checkPrepareCallbacks_data() { - QTest::addColumn>("mappingData"); - QTest::addColumn>("channelResults"); - QTest::addColumn >("expectedValues"); + QTest::addColumn>("mappingData"); + QTest::addColumn>("channelResults"); + QTest::addColumn >("expectedValues"); - QList mappingData; - QList channelResults; - QList expectedValues; + QVector mappingData; + QVector channelResults; + QVector expectedValues; // vec3 { @@ -1067,11 +1067,11 @@ private Q_SLOTS: mapping.targetId = Qt3DCore::QNodeId::createId(); mapping.propertyName = "translation"; mapping.type = static_cast(QMetaType::QVector3D); - mapping.channelIndices = QList { 0, 1, 2 }; + mapping.channelIndices = QVector { 0, 1, 2 }; mapping.callback = &callback; mapping.callbackFlags = {}; mappingData.push_back(mapping); - channelResults = QList { 1.0f, 2.0f, 3.0f }; + channelResults = QVector { 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(QMetaType::Double); - mapping.channelIndices = QList { 0 }; + mapping.channelIndices = QVector { 0 }; mapping.callback = &callback; mapping.callbackFlags = {}; mappingData.push_back(mapping); - channelResults = QList { 1.0f }; + channelResults = QVector { 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(QMetaType::Float); - mapping.channelIndices = QList { 0 }; + mapping.channelIndices = QVector { 0 }; mapping.callback = &callback; mapping.callbackFlags = Qt3DAnimation::QAnimationCallback::OnThreadPool; mappingData.push_back(mapping); - channelResults = QList { 0.5f }; + channelResults = QVector { 0.5f }; AnimationCallbackAndValue cbv; cbv.callback = mapping.callback; @@ -1142,12 +1142,12 @@ private Q_SLOTS: void checkPrepareCallbacks() { // GIVEN - QFETCH(QList, mappingData); - QFETCH(QList, channelResults); - QFETCH(QList, expectedValues); + QFETCH(QVector, mappingData); + QFETCH(QVector, channelResults); + QFETCH(QVector, expectedValues); // WHEN - QList callbacks = prepareCallbacks(mappingData, channelResults); + QVector 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 { 0.0f, 0.0f, 0.0f }; + expectedResults = QVector { 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 { 5.0f, 0.0f, 0.0f }; + expectedResults = QVector { 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 { 2.5f, 0.0f, 0.0f }; + expectedResults = QVector { 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 { 0.0f, 0.0f, 0.0f, // Translation + expectedResults = QVector { 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 { 5.0f, 0.0f, 0.0f, // Translation + expectedResults = QVector { 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 { 2.5f, 0.0f, 0.0f, // Translation + expectedResults = QVector { 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 { 5.0, -2.0f, 6.0f }; + expectedResults = QVector { 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 { 2.5f, -1.0f, 3.0f }; + expectedResults = QVector { 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 { 0.923822f, 0.382626f, 0.0f, 0.0f }; + expectedResults = QVector { 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 { 0.0f, 0.0f, 0.0f }; + expectedResults = QVector { 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 { 5.0f, 0.0f, 0.0f }; + expectedResults = QVector { 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 { 2.5f, 0.0f, 0.0f }; + expectedResults = QVector { 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 { 0.0f, 0.0f, 0.0f, // Translation + expectedResults = QVector { 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 { 5.0f, 0.0f, 0.0f, // Translation + expectedResults = QVector { 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 { 2.5f, 0.0f, 0.0f, // Translation + expectedResults = QVector { 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, expectedResults); // WHEN - const QList actualResults = channelComponentsToIndicesHelper(channel, - expectedChannelComponentCount, offset, suffixes); + const QVector actualResults = channelComponentsToIndicesHelper(channel, + expectedChannelComponentCount, offset, suffixes); // THEN QCOMPARE(actualResults.size(), expectedResults.size()); @@ -1902,8 +1902,8 @@ private Q_SLOTS: QFETCH(QList, expectedResults); // WHEN - const QList actualResults = channelComponentsToIndices(channel, - dataType, componentCount, offset); + const QVector actualResults = channelComponentsToIndices(channel, + dataType, componentCount, offset); // THEN QCOMPARE(actualResults.size(), expectedResults.size()); @@ -2308,7 +2308,7 @@ private Q_SLOTS: QFETCH(QList, expectedIds); // WHEN - const QList actualIds = gatherValueNodesToEvaluate(handler, blendTreeRootId); + const QVector actualIds = gatherValueNodesToEvaluate(handler, blendTreeRootId); // THEN QCOMPARE(actualIds.size(), expectedIds.size()); @@ -2797,7 +2797,7 @@ private Q_SLOTS: QFETCH(QList, expectedResults); // WHEN - const QList actualResults = buildRequiredChannelsAndTypes(handler, mapper); + const QVector actualResults = buildRequiredChannelsAndTypes(handler, mapper); // THEN QCOMPARE(actualResults.size(), expectedResults.size()); @@ -2810,33 +2810,33 @@ private Q_SLOTS: void checkAssignChannelComponentIndices_data() { - QTest::addColumn>("allChannels"); - QTest::addColumn>("expectedResults"); + QTest::addColumn>("allChannels"); + QTest::addColumn>("expectedResults"); { - const QList allChannels = { + const QVector allChannels = { { QLatin1String("Location"), static_cast(QMetaType::QVector3D), 3 } }; - const QList expectedResults = { { 0, 1, 2 } }; + const QVector expectedResults = { { 0, 1, 2 } }; QTest::newRow("vec3 location") << allChannels << expectedResults; } { - const QList allChannels = { + const QVector allChannels = { { QLatin1String("Location"), static_cast(QMetaType::QVector3D), 3 }, { QLatin1String("Rotation"), static_cast(QMetaType::QQuaternion), 4 } }; - const QList expectedResults = { { 0, 1, 2 }, + const QVector expectedResults = { { 0, 1, 2 }, { 3, 4, 5, 6 } }; QTest::newRow("vec3 location, quaterion rotation") << allChannels << expectedResults; } { - const QList allChannels = { + const QVector allChannels = { { QLatin1String("Location"), static_cast(QMetaType::QVector3D), 3 }, { QLatin1String("Rotation"), static_cast(QMetaType::QQuaternion), 4 }, { QLatin1String("BaseColor"), static_cast(QMetaType::QVector3D), 3 }, @@ -2845,7 +2845,7 @@ private Q_SLOTS: { QLatin1String("MorphWeights"), static_cast(QMetaType::QVariantList), 6 } }; - const QList expectedResults = { + const QVector expectedResults = { { 0, 1, 2 }, { 3, 4, 5, 6 }, { 7, 8, 9 }, @@ -2857,7 +2857,7 @@ private Q_SLOTS: } { - QList allChannels; + QVector allChannels; const int jointCount = 4; for (int i = 0; i < jointCount; ++i) { ChannelNameAndType locationDescription = { QLatin1String("Location"), static_cast(QMetaType::QVector3D), 3 }; @@ -2873,7 +2873,7 @@ private Q_SLOTS: allChannels.push_back(scaleDescription); } - const QList expectedResults = { + const QVector 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, allChannels); - QFETCH(QList, expectedResults); + QFETCH(QVector, allChannels); + QFETCH(QVector, expectedResults); // WHEN - const QList actualResults = assignChannelComponentIndices(allChannels); + const QVector actualResults = assignChannelComponentIndices(allChannels); // THEN QCOMPARE(actualResults.size(), expectedResults.size()); @@ -2906,13 +2906,13 @@ private Q_SLOTS: void checkGenerateClipFormatIndices_data() { - QTest::addColumn>("targetChannels"); - QTest::addColumn>("targetIndices"); + QTest::addColumn>("targetChannels"); + QTest::addColumn>("targetIndices"); QTest::addColumn("clip"); QTest::addColumn("expectedResults"); { - const QList targetChannels = { + const QVector targetChannels = { { QLatin1String("Rotation"), static_cast(QMetaType::QQuaternion), 4 }, { QLatin1String("Location"), static_cast(QMetaType::QVector3D), 3 }, { QLatin1String("Base Color"), static_cast(QMetaType::QVector3D), 3 }, @@ -2920,7 +2920,7 @@ private Q_SLOTS: { QLatin1String("Roughness"), static_cast(QMetaType::Double), 1 } }; - const QList targetIndices = { + const QVector targetIndices = { { 0, 1, 2, 3 }, { 4, 5, 6 }, { 7, 8, 9 }, @@ -2952,7 +2952,7 @@ private Q_SLOTS: } { - const QList targetChannels = { + const QVector targetChannels = { { QLatin1String("Location"), static_cast(QMetaType::QVector3D), 3 }, { QLatin1String("Rotation"), static_cast(QMetaType::QQuaternion), 4 }, { QLatin1String("Base Color"), static_cast(QMetaType::QVector3D), 3 }, @@ -2960,7 +2960,7 @@ private Q_SLOTS: { QLatin1String("Roughness"), static_cast(QMetaType::Double), 1 } }; - const QList targetIndices = { + const QVector targetIndices = { { 0, 1, 2 }, { 3, 4, 5, 6 }, { 7, 8, 9 }, @@ -2992,7 +2992,7 @@ private Q_SLOTS: } { - const QList targetChannels = { + const QVector targetChannels = { { QLatin1String("Rotation"), static_cast(QMetaType::QQuaternion), 4 }, { QLatin1String("Location"), static_cast(QMetaType::QVector3D), 3 }, { QLatin1String("Albedo"), static_cast(QMetaType::QVector3D), 3 }, @@ -3000,7 +3000,7 @@ private Q_SLOTS: { QLatin1String("Roughness"), static_cast(QMetaType::Double), 1 } }; - const QList targetIndices = { + const QVector targetIndices = { { 0, 1, 2, 3 }, { 4, 5, 6 }, { 7, 8, 9 }, @@ -3032,7 +3032,7 @@ private Q_SLOTS: } { - const QList targetChannels = { + const QVector targetChannels = { { QLatin1String("Location"), static_cast(QMetaType::QVector3D), 3 }, { QLatin1String("Rotation"), static_cast(QMetaType::QQuaternion), 4 }, { QLatin1String("Albedo"), static_cast(QMetaType::QVector3D), 3 }, @@ -3040,7 +3040,7 @@ private Q_SLOTS: { QLatin1String("Roughness"), static_cast(QMetaType::Double), 1 } }; - const QList targetIndices = { + const QVector targetIndices = { { 0, 1, 2 }, { 3, 4, 5, 6 }, { 7, 8, 9 }, @@ -3072,7 +3072,7 @@ private Q_SLOTS: } { - QList targetChannels; + QVector targetChannels; const int jointCount = 4; for (int i = 0; i < jointCount; ++i) { ChannelNameAndType locationDescription = { QLatin1String("Location"), static_cast(QMetaType::QVector3D), 3 }; @@ -3088,7 +3088,7 @@ private Q_SLOTS: targetChannels.push_back(scaleDescription); } - const QList targetIndices = { + const QVector 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, targetChannels); - QFETCH(QList, targetIndices); + QFETCH(QVector, targetChannels); + QFETCH(QVector, targetIndices); QFETCH(AnimationClip *, clip); QFETCH(ClipFormat, expectedResults); @@ -3171,7 +3171,7 @@ private Q_SLOTS: { QTest::addColumn("handler"); QTest::addColumn("channelDescription"); - QTest::addColumn>("expectedResults"); + QTest::addColumn>("expectedResults"); { auto handler = new Handler(); @@ -3185,7 +3185,7 @@ private Q_SLOTS: channelDescription.mappingId = channelMapping->peerId(); channelDescription.type = static_cast(QMetaType::QVector3D); channelDescription.name = QLatin1String("translation"); - const QList expectedResults = { 0.0f, 0.0f, 0.0f }; + const QVector 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(QMetaType::QQuaternion); channelDescription.name = QLatin1String("rotation"); - const QList expectedResults = { 1.0f, 0.0f, 0.0f, 0.0f }; + const QVector 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(QMetaType::QVector3D); channelDescription.name = QLatin1String("scale"); - const QList expectedResults = { 1.0f, 1.0f, 1.0f }; + const QVector expectedResults = { 1.0f, 1.0f, 1.0f }; QTest::newRow("scale") << handler << channelDescription << expectedResults; } @@ -3233,7 +3233,7 @@ private Q_SLOTS: channelDescription.type = static_cast(QMetaType::QVector3D); channelDescription.jointIndex = 0; channelDescription.jointTransformComponent = Scale; - const QList expectedResults = { 2.0f, 3.0f, 4.0f }; + const QVector 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(QMetaType::QVector3D); channelDescription.jointIndex = 0; channelDescription.jointTransformComponent = Rotation; - const QList expectedResults = { 1.0f, 0.0f, 0.0f, 0.0f }; + const QVector 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(QMetaType::QVector3D); channelDescription.jointIndex = 0; channelDescription.jointTransformComponent = Translation; - const QList expectedResults = { 2.0f, 3.0f, 4.0f }; + const QVector 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(QMetaType::QVector3D); channelDescription.jointIndex = 1; channelDescription.jointTransformComponent = Scale; - const QList expectedResults = { 20.0f, 30.0f, 40.0f }; + const QVector 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(QMetaType::QVector3D); channelDescription.jointIndex = 1; channelDescription.jointTransformComponent = Rotation; - const QList expectedResults = { 1.0f, 0.0f, 0.0f, 0.0f }; + const QVector 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(QMetaType::QVector3D); channelDescription.jointIndex = 1; channelDescription.jointTransformComponent = Translation; - const QList expectedResults = { 4.0f, 5.0f, 6.0f }; + const QVector 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, expectedResults); + QFETCH(QVector, 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 roots = { 0.0f }; + QVector 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 indexes(animatorCount); + QVector 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 indexes(animatorCount); + QVector 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, indexes); + QFETCH(QVector, indexes); QFETCH(QList, animatorIds); QFETCH(QList, 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 indexes(animatorCount); + QVector 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 indexes(animatorCount); + QVector 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) +Q_DECLARE_METATYPE(QVector) -using MappingDataResults = QHash>; +using MappingDataResults = QHash>; Q_DECLARE_METATYPE(MappingDataResults) class tst_FindRunningClipAnimatorsJob: public Qt3DCore::QBackendNodeTester @@ -116,7 +116,7 @@ private Q_SLOTS: void checkJob_data() { QTest::addColumn("handler"); - QTest::addColumn>("dirtyClipAnimators"); + QTest::addColumn>("dirtyClipAnimators"); QTest::addColumn("expectedResults"); @@ -133,7 +133,7 @@ private Q_SLOTS: const int loops = 1; animator = createClipAnimator(handler, globalStartTimeNS, loops); animator->setClipId(clip->peerId()); - const QList dirtyClipAnimators + const QVector 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 { expectedMapping }); + expectedResults.insert(animator, QVector { 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 dirtyClipAnimators + const QVector dirtyClipAnimators = { handler->clipAnimatorManager()->getOrAcquireHandle(animator->peerId()) }; auto channelMapping = createChannelMapping(handler, @@ -199,7 +199,7 @@ private Q_SLOTS: { // GIVEN QFETCH(Handler *, handler); - QFETCH(QList, dirtyClipAnimators); + QFETCH(QVector, 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 actualMappingData = animator->mappingData(); - const QList expectedMappingData = expectedResults[animator]; + const QVector actualMappingData = animator->mappingData(); + const QVector 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("correlationThreshold"); QTest::addColumn("ascending"); - QList data = { 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f }; + QVector 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>("needles"); QTest::addColumn>("lowerBounds"); - QList data = { 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f }; - QList needles = { 2.5f }; - QList lowerBounds = { 1 }; + QVector data = { 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f }; + QVector needles = { 2.5f }; + QVector 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(QMetaType::QVariantList) << 5; - QList vec(8); + QVector vec(8); QTest::newRow("vector") << QByteArrayLiteral("vecProperty") << QVariant::fromValue(vec) << qMetaTypeId() << 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 positions = { 0.0f, 1.0f, 2.0f, 3.0f, 4.0f }; + const QVector positions = { 0.0f, 1.0f, 2.0f, 3.0f, 4.0f }; morphingAnimation.setTargetPositions(positions); - morphingAnimation.setWeights(0, QList { 1.0f, 0.0f, 0.0f }); - morphingAnimation.setWeights(1, QList { 0.0f, 0.0f, 0.0f }); - morphingAnimation.setWeights(2, QList { 0.0f, 1.0f, 0.0f }); - morphingAnimation.setWeights(3, QList { 0.0f, 0.0f, 0.0f }); - morphingAnimation.setWeights(4, QList { 0.0f, 0.0f, 1.0f }); + morphingAnimation.setWeights(0, QVector { 1.0f, 0.0f, 0.0f }); + morphingAnimation.setWeights(1, QVector { 0.0f, 0.0f, 0.0f }); + morphingAnimation.setWeights(2, QVector { 0.0f, 1.0f, 0.0f }); + morphingAnimation.setWeights(3, QVector { 0.0f, 0.0f, 0.0f }); + morphingAnimation.setWeights(4, QVector { 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 jointNames = { QLatin1String("rootJoint"), + const QVector jointNames = { QLatin1String("rootJoint"), QLatin1String("child1Joint"), QLatin1String("child2Joint") }; @@ -103,10 +103,10 @@ private Q_SLOTS: QCOMPARE(backendSkeleton.jointLocalPoses().size(), 0); // GIVEN - const QList names = { QLatin1String("root"), - QLatin1String("child1"), - QLatin1String("child2") }; - const QList localPoses = { Sqt(), Sqt(), Sqt() }; + const QVector names = { QLatin1String("root"), + QLatin1String("child1"), + QLatin1String("child2") }; + const QVector 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 data(16); + QVector 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 renderQueue; renderQueue.setTargetRenderViewCount(7); - QList renderViews(7); + QVector renderViews(7); // WHEN for (int i = 0; i < 7; ++i) { @@ -122,7 +122,7 @@ void tst_RenderQueue::checkTimeToSubmit() // GIVEN Qt3DRender::Render::RenderQueue renderQueue; renderQueue.setTargetRenderViewCount(7); - QList renderViews(7); + QVector renderViews(7); // WHEN for (int i = 0; i < 7; i++) { @@ -222,7 +222,7 @@ void tst_RenderQueue::resetQueue() QVERIFY(renderQueue.currentRenderViewCount() == 0); // WHEN - QList renderViews(5); + QVector 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 matrices = { m1, m2, m3, m4 }; + const QVector 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 matrices1 = { m1, m2, m3, m4 }; + const QVector matrices1 = { m1, m2, m3, m4 }; UniformValue v(matrices1); // WHEN - const QList matrices2 = { m4, m3, m2, m1, m4 }; + const QVector matrices2 = { m4, m3, m2, m1, m4 }; v.setData(matrices2); // THEN @@ -405,7 +405,7 @@ private Q_SLOTS: // GIVEN const int positionCount = 10; - QList positions(positionCount); + QVector 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 allocator; const int max = (1 << 16) - 1; - QList> resources(max); - for (int i = 0; i < max; i++) { + std::vector> 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 void benchmarkAccessResources() { Qt3DCore::QResourceManager manager; - const int max = (1 << 16) - 1; - QList > handles(max); - for (int i = 0; i < max; i++) + const size_t max = (1 << 16) - 1; + std::vector > 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 void benchmarkRandomAccessResource() { Qt3DCore::QResourceManager manager; - const int max = (1 << 16) - 1; - QList > handles(max); - for (int i = 0; i < max; i++) + const size_t max = (1 << 16) - 1; + std::vector > 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 manager; const int max = (1 << 16) - 1; - QList resourcesIndices(max); + QVector resourcesIndices(max); for (int i = 0; i < max; i++) { manager.getOrCreateResource(i); resourcesIndices[i] = i; @@ -161,11 +161,11 @@ template void benchmarkReleaseResources() { Qt3DCore::QResourceManager manager; - const int max = (1 << 16) - 1; - QList > handles(max); - for (int i = 0; i < max; i++) + const size_t max = (1 << 16) - 1; + std::vector > 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 randKeys(64); + std::vector 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 orderedPositionVertices; + QVector orderedPositionVertices; // 12 vertices with position, normal, color orderedPositionVertices.reserve(12 * (1 + 1 + 1)); -- cgit v1.2.3