summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Krus <mike.krus@kdab.com>2020-11-20 16:47:37 +0000
committerMike Krus <mike.krus@kdab.com>2021-01-05 13:57:54 +0000
commit173be1a93699c54d9680d809ca5a56ce0ccccd9a (patch)
treebf773d21f61edbc522e8b4128d40f2cb5458a0c2
parent45dfb8a03f4ee2abb963ce3726eaef0dd1c2c521 (diff)
Restore use of QVector in private API
Facilitates building against Qt 5.15. Will migrate to std::vector over time. Change-Id: I5db14c9ea95b38e4b2d596d7397fef76f6baf118 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
-rw-r--r--src/animation/backend/abstractevaluateclipanimatorjob.cpp4
-rw-r--r--src/animation/backend/abstractevaluateclipanimatorjob_p.h2
-rw-r--r--src/animation/backend/animationclip_p.h9
-rw-r--r--src/animation/backend/animationutils.cpp58
-rw-r--r--src/animation/backend/animationutils_p.h46
-rw-r--r--src/animation/backend/blendedclipanimator_p.h6
-rw-r--r--src/animation/backend/buildblendtreesjob.cpp27
-rw-r--r--src/animation/backend/buildblendtreesjob_p.h4
-rw-r--r--src/animation/backend/channelmapper_p.h10
-rw-r--r--src/animation/backend/clipanimator_p.h6
-rw-r--r--src/animation/backend/evaluateblendclipanimatorjob.cpp4
-rw-r--r--src/animation/backend/fcurve_p.h2
-rw-r--r--src/animation/backend/findrunningclipanimatorsjob.cpp10
-rw-r--r--src/animation/backend/findrunningclipanimatorsjob_p.h4
-rw-r--r--src/animation/backend/gltfimporter.cpp2
-rw-r--r--src/animation/backend/gltfimporter_p.h2
-rw-r--r--src/animation/backend/handler.cpp8
-rw-r--r--src/animation/backend/handler_p.h24
-rw-r--r--src/animation/backend/loadanimationclipjob.cpp2
-rw-r--r--src/animation/backend/loadanimationclipjob_p.h4
-rw-r--r--src/animation/backend/skeleton_p.h14
-rw-r--r--src/animation/frontend/qanimationclipdata.cpp2
-rw-r--r--src/animation/frontend/qchannel.cpp2
-rw-r--r--src/animation/frontend/qchannelcomponent.cpp2
-rw-r--r--src/animation/frontend/qmorphinganimation.cpp20
-rw-r--r--src/animation/frontend/qmorphinganimation.h16
-rw-r--r--src/animation/frontend/qmorphinganimation_p.h8
-rw-r--r--src/core/resources/qframeallocator_p_p.h4
-rw-r--r--src/core/transforms/qabstractskeleton_p.h4
-rw-r--r--src/extras/3dtext/qextrudedtextgeometry.cpp14
-rw-r--r--src/extras/text/distancefieldtextrenderer.cpp4
-rw-r--r--src/extras/text/distancefieldtextrenderer_p.h4
-rw-r--r--src/extras/text/qdistancefieldglyphcache.cpp4
-rw-r--r--src/extras/text/qtext2dentity.cpp8
-rw-r--r--src/input/backend/movingaverage_p.h2
-rw-r--r--src/plugins/sceneparsers/gltf/gltfimporter.cpp4
-rw-r--r--src/plugins/sceneparsers/gltfexport/gltfexporter.cpp2
-rw-r--r--src/plugins/sceneparsers/gltfexport/gltfexporter.h4
-rw-r--r--src/render/backend/uniform.cpp2
-rw-r--r--src/render/backend/uniform_p.h6
-rw-r--r--src/render/geometry/gltfskeletonloader_p.h10
-rw-r--r--src/render/geometry/skeleton.cpp6
-rw-r--r--src/render/geometry/skeleton_p.h10
-rw-r--r--src/render/geometry/skeletondata_p.h6
-rw-r--r--src/render/jobs/updateskinningpalettejob.cpp2
-rw-r--r--tests/auto/animation/animationutils/tst_animationutils.cpp318
-rw-r--r--tests/auto/animation/bezierevaluator/tst_bezierevaluator.cpp2
-rw-r--r--tests/auto/animation/clipblendnode/tst_clipblendnode.cpp6
-rw-r--r--tests/auto/animation/clipblendvalue/tst_clipblendvalue.cpp4
-rw-r--r--tests/auto/animation/findrunningclipanimatorsjob/tst_findrunningclipanimatorsjob.cpp18
-rw-r--r--tests/auto/animation/functionrangefinder/tst_functionrangefinder.cpp8
-rw-r--r--tests/auto/animation/qchannelmapping/tst_qchannelmapping.cpp2
-rw-r--r--tests/auto/animation/qmorphinganimation/tst_qmorphinganimation.cpp12
-rw-r--r--tests/auto/animation/skeleton/tst_skeleton.cpp10
-rw-r--r--tests/auto/core/nodes/tst_nodes.cpp4
-rw-r--r--tests/auto/render/opengl/qgraphicsutils/tst_qgraphicsutils.cpp2
-rw-r--r--tests/auto/render/opengl/renderqueue/tst_renderqueue.cpp6
-rw-r--r--tests/auto/render/uniform/tst_uniform.cpp8
-rw-r--r--tests/benchmarks/core/qresourcesmanager/arraypolicy/tst_bench_arraypolicy.cpp4
-rw-r--r--tests/benchmarks/core/qresourcesmanager/qresourcesmanager/tst_bench_qresourcesmanager.cpp26
-rw-r--r--tests/benchmarks/render/opengl/shaderparameterpack/tst_bench_shaderparameterpack.cpp4
-rw-r--r--tests/manual/custom-mesh-cpp-indirect/main.cpp2
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<AnimationCallbackAndValue> m_callbacks;
+ QVector<AnimationCallbackAndValue> m_callbacks;
};
AbstractEvaluateClipAnimatorJob::AbstractEvaluateClipAnimatorJob()
@@ -62,7 +62,7 @@ AbstractEvaluateClipAnimatorJob::AbstractEvaluateClipAnimatorJob()
{
}
-void AbstractEvaluateClipAnimatorJob::setPostFrameData(const AnimationRecord &record, const QList<AnimationCallbackAndValue> &callbacks)
+void AbstractEvaluateClipAnimatorJob::setPostFrameData(const AnimationRecord &record, const QVector<AnimationCallbackAndValue> &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<AnimationCallbackAndValue> &callbacks);
+ void setPostFrameData(const AnimationRecord &record, const QVector<AnimationCallbackAndValue> &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<Channel> &channels() const { return m_channels; }
+ const QVector<Channel> &channels() const { return m_channels; }
// Called from jobs
void loadAnimation();
@@ -117,7 +117,7 @@ private:
ClipDataType m_dataType;
QString m_name;
- QList<Channel> m_channels;
+ QVector<Channel> 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<Channel> 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<float> valueToVector(const QVector3D &value)
+inline QVector<float> valueToVector(const QVector3D &value)
{
return { value.x(), value.y(), value.z() };
}
-inline QList<float> valueToVector(const QQuaternion &value)
+inline QVector<float> 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<float> channelResults;
+ QVector<float> 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<Channel> &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<typename Container>
Container mapChannelResultsToContainer(const MappingData &mappingData,
- const QList<float> &channelResults)
+ const QVector<float> &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<float> &channelResults)
+QVariant buildPropertyValue(const MappingData &mappingData, const QVector<float> &channelResults)
{
const int vectorOfFloatType = qMetaTypeId<QList<float>>();
@@ -410,8 +410,8 @@ QVariant buildPropertyValue(const MappingData &mappingData, const QList<float> &
}
AnimationRecord prepareAnimationRecord(Qt3DCore::QNodeId animatorId,
- const QList<MappingData> &mappingDataVec,
- const QList<float> &channelResults,
+ const QVector<MappingData> &mappingDataVec,
+ const QVector<float> &channelResults,
bool finalFrame,
float normalizedLocalTime)
{
@@ -469,10 +469,10 @@ AnimationRecord prepareAnimationRecord(Qt3DCore::QNodeId animatorId,
return record;
}
-QList<AnimationCallbackAndValue> prepareCallbacks(const QList<MappingData> &mappingDataVec,
- const QList<float> &channelResults)
+QVector<AnimationCallbackAndValue> prepareCallbacks(const QVector<MappingData> &mappingDataVec,
+ const QVector<float> &channelResults)
{
- QList<AnimationCallbackAndValue> callbacks;
+ QVector<AnimationCallbackAndValue> callbacks;
for (const MappingData &mappingData : mappingDataVec) {
if (!mappingData.callback)
continue;
@@ -492,10 +492,10 @@ QList<AnimationCallbackAndValue> prepareCallbacks(const QList<MappingData> &mapp
// buildRequiredChannelsAndTypes() and assignChannelComponentIndices(). We are
// currently repeating the iteration over mappings and extracting/generating
// channel names, types and joint indices.
-QList<MappingData> buildPropertyMappings(const QList<ChannelMapping*> &channelMappings,
- const QList<ChannelNameAndType> &channelNamesAndTypes,
- const QList<ComponentIndices> &channelComponentIndices,
- const QList<QBitArray> &sourceClipMask)
+QVector<MappingData> buildPropertyMappings(const QVector<ChannelMapping *> &channelMappings,
+ const QVector<ChannelNameAndType> &channelNamesAndTypes,
+ const QVector<ComponentIndices> &channelComponentIndices,
+ const QVector<QBitArray> &sourceClipMask)
{
// Accumulate the required number of mappings
int maxMappingDatas = 0;
@@ -513,7 +513,7 @@ QList<MappingData> buildPropertyMappings(const QList<ChannelMapping*> &channelMa
}
}
}
- QList<MappingData> mappingDataVec;
+ QVector<MappingData> mappingDataVec;
mappingDataVec.reserve(maxMappingDatas);
// Iterate over the mappings
@@ -622,15 +622,15 @@ QList<MappingData> buildPropertyMappings(const QList<ChannelMapping*> &channelMa
return mappingDataVec;
}
-QList<ChannelNameAndType> buildRequiredChannelsAndTypes(Handler *handler,
+QVector<ChannelNameAndType> buildRequiredChannelsAndTypes(Handler *handler,
const ChannelMapper *mapper)
{
ChannelMappingManager *mappingManager = handler->channelMappingManager();
- const QList<Qt3DCore::QNodeId> 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<ChannelNameAndType> namesAndTypes;
+ QVector<ChannelNameAndType> namesAndTypes;
namesAndTypes.reserve(mappingIds.size());
// Iterate through the mappings and add ones not already used by an earlier mapping.
@@ -690,9 +690,9 @@ QList<ChannelNameAndType> buildRequiredChannelsAndTypes(Handler *handler,
return namesAndTypes;
}
-QList<ComponentIndices> assignChannelComponentIndices(const QList<ChannelNameAndType> &namesAndTypes)
+QVector<ComponentIndices> assignChannelComponentIndices(const QVector<ChannelNameAndType> &namesAndTypes)
{
- QList<ComponentIndices> channelComponentIndices;
+ QVector<ComponentIndices> channelComponentIndices;
channelComponentIndices.reserve(namesAndTypes.size());
int baseIndex = 0;
@@ -712,7 +712,7 @@ QList<ComponentIndices> assignChannelComponentIndices(const QList<ChannelNameAnd
return channelComponentIndices;
}
-QList<Qt3DCore::QNodeId> gatherValueNodesToEvaluate(Handler *handler,
+QVector<Qt3DCore::QNodeId> gatherValueNodesToEvaluate(Handler *handler,
Qt3DCore::QNodeId blendTreeRootId)
{
Q_ASSERT(handler);
@@ -722,7 +722,7 @@ QList<Qt3DCore::QNodeId> gatherValueNodesToEvaluate(Handler *handler,
ClipBlendNodeManager *nodeManager = handler->clipBlendNodeManager();
// Visit the tree in a pre-order manner and collect the dependencies
- QList<Qt3DCore::QNodeId> clipIds;
+ QVector<Qt3DCore::QNodeId> clipIds;
ClipBlendNodeVisitor visitor(nodeManager,
ClipBlendNodeVisitor::PreOrder,
ClipBlendNodeVisitor::VisitOnlyDependencies);
@@ -750,8 +750,8 @@ QList<Qt3DCore::QNodeId> gatherValueNodesToEvaluate(Handler *handler,
return clipIds;
}
-ClipFormat generateClipFormatIndices(const QList<ChannelNameAndType> &targetChannels,
- const QList<ComponentIndices> &targetIndices,
+ClipFormat generateClipFormatIndices(const QVector<ChannelNameAndType> &targetChannels,
+ const QVector<ComponentIndices> &targetIndices,
const AnimationClip *clip)
{
Q_ASSERT(targetChannels.size() == targetIndices.size());
@@ -865,10 +865,10 @@ ClipResults evaluateBlendTree(Handler *handler,
return blendTreeRootNode->clipResults(animatorId);
}
-QList<float> defaultValueForChannel(Handler *handler,
+QVector<float> defaultValueForChannel(Handler *handler,
const ChannelNameAndType &channelDescription)
{
- QList<float> result;
+ QVector<float> 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<float> defaultValueForChannel(Handler *handler,
// Everything else gets all zeros
const int componentCount = mapping->componentCount();
- result = QList<float>(componentCount, 0.0f);
+ result = QVector<float>(componentCount, 0.0f);
break;
}
@@ -924,7 +924,7 @@ QList<float> defaultValueForChannel(Handler *handler,
return result;
}
-void applyComponentDefaultValues(const QList<ComponentValue> &componentDefaults,
+void applyComponentDefaultValues(const QVector<ComponentValue> &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<int>;
+using ComponentIndices = QVector<int>;
enum JointTransformComponent {
NoTransformComponent = 0,
@@ -125,7 +125,7 @@ struct ClipEvaluationData
bool isFinalFrame;
};
-using ClipResults = QList<float>;
+using ClipResults = QVector<float>;
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<QBitArray> sourceClipMask;
- QList<ComponentIndices> formattedComponentIndices;
- QList<ChannelNameAndType> namesAndTypes;
- QList<ComponentValue> defaultComponentValues;
+ QVector<QBitArray> sourceClipMask;
+ QVector<ComponentIndices> formattedComponentIndices;
+ QVector<ChannelNameAndType> namesAndTypes;
+ QVector<ComponentValue> defaultComponentValues;
};
#ifndef QT_NO_DEBUG_STREAM
@@ -279,15 +279,15 @@ struct AnimationRecord {
Qt3DCore::QNodeId animatorId;
QList<TargetChange> targetChanges;
- QList<QPair<Qt3DCore::QNodeId, QList<Qt3DCore::Sqt>>> skeletonChanges;
+ QList<QPair<Qt3DCore::QNodeId, QVector<Qt3DCore::Sqt>>> skeletonChanges;
float normalizedTime = -1.f;
bool finalFrame = false;
};
Q_AUTOTEST_EXPORT
AnimationRecord prepareAnimationRecord(Qt3DCore::QNodeId animatorId,
- const QList<MappingData> &mappingDataVec,
- const QList<float> &channelResults,
+ const QVector<MappingData> &mappingDataVec,
+ const QVector<float> &channelResults,
bool finalFrame,
float normalizedLocalTime);
@@ -359,21 +359,21 @@ ClipResults evaluateClipAtPhase(AnimationClip *clip,
float phase);
Q_AUTOTEST_EXPORT
-QList<AnimationCallbackAndValue> prepareCallbacks(const QList<MappingData> &mappingDataVec,
- const QList<float> &channelResults);
+QVector<AnimationCallbackAndValue> prepareCallbacks(const QVector<MappingData> &mappingDataVec,
+ const QVector<float> &channelResults);
Q_AUTOTEST_EXPORT
-QList<MappingData> buildPropertyMappings(const QList<ChannelMapping *> &channelMappings,
- const QList<ChannelNameAndType> &channelNamesAndTypes,
- const QList<ComponentIndices> &channelComponentIndices,
- const QList<QBitArray> &sourceClipMask);
+QVector<MappingData> buildPropertyMappings(const QVector<ChannelMapping *> &channelMappings,
+ const QVector<ChannelNameAndType> &channelNamesAndTypes,
+ const QVector<ComponentIndices> &channelComponentIndices,
+ const QVector<QBitArray> &sourceClipMask);
Q_AUTOTEST_EXPORT
-QList<ChannelNameAndType> buildRequiredChannelsAndTypes(Handler *handler,
- const ChannelMapper *mapper);
+QVector<ChannelNameAndType> buildRequiredChannelsAndTypes(Handler *handler,
+ const ChannelMapper *mapper);
Q_AUTOTEST_EXPORT
-QList<ComponentIndices> assignChannelComponentIndices(const QList<ChannelNameAndType> &namesAndTypes);
+QVector<ComponentIndices> assignChannelComponentIndices(const QVector<ChannelNameAndType> &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 &currentLoop);
Q_AUTOTEST_EXPORT
-QList<Qt3DCore::QNodeId> gatherValueNodesToEvaluate(Handler *handler,
+QVector<Qt3DCore::QNodeId> gatherValueNodesToEvaluate(Handler *handler,
Qt3DCore::QNodeId blendTreeRootId);
Q_AUTOTEST_EXPORT
-ClipFormat generateClipFormatIndices(const QList<ChannelNameAndType> &targetChannels,
- const QList<ComponentIndices> &targetIndices,
+ClipFormat generateClipFormatIndices(const QVector<ChannelNameAndType> &targetChannels,
+ const QVector<ComponentIndices> &targetIndices,
const AnimationClip *clip);
Q_AUTOTEST_EXPORT
@@ -404,10 +404,10 @@ ClipResults evaluateBlendTree(Handler *handler,
Qt3DCore::QNodeId blendNodeId);
Q_AUTOTEST_EXPORT
-QList<float> defaultValueForChannel(Handler *handler, const ChannelNameAndType &channelDescription);
+QVector<float> defaultValueForChannel(Handler *handler, const ChannelNameAndType &channelDescription);
Q_AUTOTEST_EXPORT
-void applyComponentDefaultValues(const QList<ComponentValue> &componentDefaults,
+void applyComponentDefaultValues(const QVector<ComponentValue> &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> &mappingData) { m_mappingData = mappingData; }
- QList<MappingData> mappingData() const { return m_mappingData; }
+ void setMappingData(const QVector<MappingData> &mappingData) { m_mappingData = mappingData; }
+ QVector<MappingData> mappingData() const { return m_mappingData; }
void animationClipMarkedDirty() { setDirty(Handler::BlendedClipAnimatorDirty); }
@@ -123,7 +123,7 @@ private:
float m_normalizedLocalTime;
float m_lastNormalizedLocalTime;
- QList<MappingData> m_mappingData;
+ QVector<MappingData> 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<HBlendedClipAnimator> &blendedClipAnimatorHandles)
+void BuildBlendTreesJob::setBlendedClipAnimators(const QVector<HBlendedClipAnimator> &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<ChannelNameAndType> channelNamesAndTypes
+ const QVector<ChannelNameAndType> channelNamesAndTypes
= buildRequiredChannelsAndTypes(m_handler, mapper);
- const QList<ComponentIndices> channelComponentIndices
+ const QVector<ComponentIndices> 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<QBitArray> blendTreeChannelMask;
- const QList<Qt3DCore::QNodeId> valueNodeIds
+ QVector<QBitArray> blendTreeChannelMask;
+ const QVector<Qt3DCore::QNodeId> 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<float> defaultValue = defaultValueForChannel(m_handler,
- f.namesAndTypes[i]);
+ const QVector<float> 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<Qt3DCore::QNodeId> channelMappingIds = mapper->mappingIds();
- QList<ChannelMapping *> channelMappings;
+ const Qt3DCore::QNodeIdVector channelMappingIds = mapper->mappingIds();
+ QVector<ChannelMapping *> 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<MappingData> mappingDataVec
- = buildPropertyMappings(channelMappings,
- channelNamesAndTypes,
- channelComponentIndices,
- blendTreeChannelMask);
+ const QVector<MappingData> 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<HBlendedClipAnimator> &blendedClipAnimatorHandles);
+ void setBlendedClipAnimators(const QVector<HBlendedClipAnimator> &blendedClipAnimatorHandles);
protected:
void run() override;
private:
- QList<HBlendedClipAnimator> m_blendedClipAnimatorHandles;
+ QVector<HBlendedClipAnimator> 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<Qt3DCore::QNodeId> &mappingIds) { m_mappingIds = mappingIds; }
- QList<Qt3DCore::QNodeId> mappingIds() const { return m_mappingIds; }
+ void setMappingIds(const Qt3DCore::QNodeIdVector &mappingIds) { m_mappingIds = mappingIds; }
+ Qt3DCore::QNodeIdVector mappingIds() const { return m_mappingIds; }
- QList<ChannelMapping*> mappings() const
+ QVector<ChannelMapping*> mappings() const
{
if (m_isDirty)
updateMappings();
@@ -84,10 +84,10 @@ public:
private:
void updateMappings() const;
- QList<Qt3DCore::QNodeId> m_mappingIds;
+ Qt3DCore::QNodeIdVector m_mappingIds;
// Cached data
- mutable QList<ChannelMapping*> m_mappings;
+ mutable QVector<ChannelMapping*> 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> &mappingData) { m_mappingData = mappingData; }
- QList<MappingData> mappingData() const { return m_mappingData; }
+ void setMappingData(const QVector<MappingData> &mappingData) { m_mappingData = mappingData; }
+ QVector<MappingData> 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<MappingData> m_mappingData;
+ QVector<MappingData> 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<Qt3DCore::QNodeId> valueNodeIdsToEvaluate = gatherValueNodesToEvaluate(m_handler, blendTreeRootId);
+ const QVector<Qt3DCore::QNodeId> 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> mappingData = blendedClipAnimator->mappingData();
+ const QVector<MappingData> 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<ChannelComponent> channelComponents;
+ QVector<ChannelComponent> 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<HClipAnimator> &clipAnimatorHandles)
+void FindRunningClipAnimatorsJob::setDirtyClipAnimators(const QVector<HClipAnimator> &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<ChannelMapping *> channelMappings = mapper->mappings();
+ const QVector<ChannelMapping *> channelMappings = mapper->mappings();
- const QList<ChannelNameAndType> channelNamesAndTypes
+ const QVector<ChannelNameAndType> channelNamesAndTypes
= buildRequiredChannelsAndTypes(m_handler, mapper);
- const QList<ComponentIndices> channelComponentIndices
+ const QVector<ComponentIndices> 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> mappingData = buildPropertyMappings(channelMappings,
+ const QVector<MappingData> 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<HClipAnimator> &animationClipHandles);
+ void setDirtyClipAnimators(const QVector<HClipAnimator> &animationClipHandles);
protected:
void run() override;
private:
- QList<HClipAnimator> m_clipAnimatorHandles;
+ QVector<HClipAnimator> 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<float> keyframeTimes(keyFrameCount);
+ QVector<float> keyframeTimes(keyFrameCount);
for (int i = 0; i < keyFrameCount; ++i) {
const auto rawTimestamp = accessorData(sampler.inputAccessorIndex, i);
keyframeTimes[i] = *reinterpret_cast<const float*>(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<Qt3DAnimation::Animation::Channel> channels;
+ QVector<Qt3DAnimation::Animation::Channel> 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<HAnimationClip> *clips)
+void Handler::cleanupHandleList(QVector<HAnimationClip> *clips)
{
for (auto it = clips->begin(); it != clips->end(); ) {
if (!m_animationClipLoaderManager->data(*it))
@@ -156,7 +156,7 @@ void Handler::cleanupHandleList(QList<HAnimationClip> *clips)
}
}
-void Handler::cleanupHandleList(QList<HClipAnimator> *animators)
+void Handler::cleanupHandleList(QVector<HClipAnimator> *animators)
{
for (auto it = animators->begin(); it != animators->end(); ) {
if (!m_clipAnimatorManager->data(*it))
@@ -166,7 +166,7 @@ void Handler::cleanupHandleList(QList<HClipAnimator> *animators)
}
}
-void Handler::cleanupHandleList(QList<HBlendedClipAnimator> *animators)
+void Handler::cleanupHandleList(QVector<HBlendedClipAnimator> *animators)
{
for (auto it = animators->begin(); it != animators->end(); ) {
if (!m_blendedClipAnimatorManager->data(*it))
@@ -218,7 +218,7 @@ std::vector<Qt3DCore::QAspectJobPtr> Handler::jobsToExecute(qint64 time)
// Rebuild blending trees if a blend tree is dirty
const bool hasBuildBlendTreesJob = !m_dirtyBlendedAnimators.isEmpty();
if (hasBuildBlendTreesJob) {
- const QList<HBlendedClipAnimator> dirtyBlendedAnimators = std::move(m_dirtyBlendedAnimators);
+ const QVector<HBlendedClipAnimator> 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<HClipAnimator> runningClipAnimators() const { return m_runningClipAnimators; }
+ QVector<HClipAnimator> runningClipAnimators() const { return m_runningClipAnimators; }
void setBlendedClipAnimatorRunning(const HBlendedClipAnimator &handle, bool running);
- QList<HBlendedClipAnimator> runningBlenndedClipAnimators() const { return m_runningBlendedClipAnimators; }
+ QVector<HBlendedClipAnimator> 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<Qt3DCore::QAspectJobPtr> jobsToExecute(qint64 time);
- void cleanupHandleList(QList<HAnimationClip> *clips);
- void cleanupHandleList(QList<HClipAnimator> *animators);
- void cleanupHandleList(QList<HBlendedClipAnimator> *animators);
+ void cleanupHandleList(QVector<HAnimationClip> *clips);
+ void cleanupHandleList(QVector<HClipAnimator> *animators);
+ void cleanupHandleList(QVector<HBlendedClipAnimator> *animators);
private:
QMutex m_mutex;
@@ -136,17 +136,17 @@ private:
QScopedPointer<ClipBlendNodeManager> m_clipBlendNodeManager;
QScopedPointer<SkeletonManager> m_skeletonManager;
- QList<HAnimationClip> m_dirtyAnimationClips;
- QList<HClipAnimator> m_dirtyClipAnimators;
- QList<HBlendedClipAnimator> m_dirtyBlendedAnimators;
+ QVector<HAnimationClip> m_dirtyAnimationClips;
+ QVector<HClipAnimator> m_dirtyClipAnimators;
+ QVector<HBlendedClipAnimator> m_dirtyBlendedAnimators;
- QList<HClipAnimator> m_runningClipAnimators;
- QList<HBlendedClipAnimator> m_runningBlendedClipAnimators;
+ QVector<HClipAnimator> m_runningClipAnimators;
+ QVector<HBlendedClipAnimator> m_runningBlendedClipAnimators;
QSharedPointer<LoadAnimationClipJob> m_loadAnimationClipJob;
QSharedPointer<FindRunningClipAnimatorsJob> m_findRunningClipAnimatorsJob;
- QList<QSharedPointer<EvaluateClipAnimatorJob>> m_evaluateClipAnimatorJobs;
- QList<EvaluateBlendClipAnimatorJobPtr> m_evaluateBlendClipAnimatorJobs;
+ QVector<QSharedPointer<EvaluateClipAnimatorJob>> m_evaluateClipAnimatorJobs;
+ QVector<EvaluateBlendClipAnimatorJobPtr> 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<HAnimationClip> &animationClipHandles)
+void LoadAnimationClipJob::addDirtyAnimationClips(const QVector<HAnimationClip> &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<HAnimationClip> &animationClipHandles);
+ void addDirtyAnimationClips(const QVector<HAnimationClip> &animationClipHandles);
void clearDirtyAnimationClips();
protected:
@@ -78,7 +78,7 @@ protected:
private:
Q_DECLARE_PRIVATE(LoadAnimationClipJob)
- QList<HAnimationClip> m_animationClipHandles;
+ QVector<HAnimationClip> 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<Qt3DCore::Sqt> joints() const { return m_jointLocalPoses; }
+ QVector<Qt3DCore::Sqt> 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<QString> &names) { m_jointNames = names; }
- QList<QString> jointNames() const { return m_jointNames; }
- void setJointLocalPoses(const QList<Qt3DCore::Sqt> &localPoses) { m_jointLocalPoses = localPoses; }
- QList<Qt3DCore::Sqt> jointLocalPoses() const { return m_jointLocalPoses; }
+ void setJointNames(const QVector<QString> &names) { m_jointNames = names; }
+ QVector<QString> jointNames() const { return m_jointNames; }
+ void setJointLocalPoses(const QVector<Qt3DCore::Sqt> &localPoses) { m_jointLocalPoses = localPoses; }
+ QVector<Qt3DCore::Sqt> jointLocalPoses() const { return m_jointLocalPoses; }
#endif
private:
- QList<QString> m_jointNames;
- QList<Qt3DCore::Sqt> m_jointLocalPoses;
+ QVector<QString> m_jointNames;
+ QVector<Qt3DCore::Sqt> 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<QChannel> m_channels;
+ QVector<QChannel> 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<QChannelComponent> m_channelComponents;
+ QVector<QChannelComponent> 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<QKeyFrame> m_keyFrames;
+ QVector<QKeyFrame> 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<float> *weights : qAsConst(m_weights))
+ for (QVector<float> *weights : qAsConst(m_weights))
delete weights;
}
@@ -189,7 +189,7 @@ void QMorphingAnimationPrivate::updateAnimation(float position)
if (!m_target || !m_target->geometry())
return;
- QList<int> relevantValues;
+ QVector<int> 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<float> QMorphingAnimation::targetPositions() const
+QVector<float> 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<Qt3DAnimation::QMorphTarget *> &targets)
+void QMorphingAnimation::setMorphTargets(const QVector<Qt3DAnimation::QMorphTarget *> &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<float> &targetPositions)
+void QMorphingAnimation::setTargetPositions(const QVector<float> &targetPositions)
{
Q_D(QMorphingAnimation);
d->m_targetPositions = targetPositions;
@@ -365,7 +365,7 @@ void QMorphingAnimation::setTargetPositions(const QList<float> &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<float>();
+ d->m_weights[i] = new QVector<float>();
}
}
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<float> &weights)
+void QMorphingAnimation::setWeights(int positionIndex, const QVector<float> &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<float>();
+ d->m_weights[positionIndex] = new QVector<float>();
*d->m_weights[positionIndex] = weights;
d->m_position = -1.0f;
}
@@ -398,7 +398,7 @@ void QMorphingAnimation::setWeights(int positionIndex, const QList<float> &weigh
/*!
Return morph weights at \a positionIndex.
*/
-QList<float> QMorphingAnimation::getWeights(int positionIndex)
+QVector<float> QMorphingAnimation::getWeights(int positionIndex)
{
Q_D(QMorphingAnimation);
return *d->m_weights[positionIndex];
@@ -407,7 +407,7 @@ QList<float> QMorphingAnimation::getWeights(int positionIndex)
/*!
Return morph target list.
*/
-QList<Qt3DAnimation::QMorphTarget *> QMorphingAnimation::morphTargetList()
+QVector<QMorphTarget *> 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<float> targetPositions READ targetPositions WRITE setTargetPositions NOTIFY targetPositionsChanged)
+ Q_PROPERTY(QVector<float> 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<float> targetPositions() const;
+ QVector<float> targetPositions() const;
float interpolator() const;
Qt3DRender::QGeometryRenderer *target() const;
QString targetName() const;
QMorphingAnimation::Method method() const;
QEasingCurve easing() const;
- void setMorphTargets(const QList<Qt3DAnimation::QMorphTarget *> &targets);
+ void setMorphTargets(const QVector<Qt3DAnimation::QMorphTarget *> &targets);
void addMorphTarget(Qt3DAnimation::QMorphTarget *target);
void removeMorphTarget(Qt3DAnimation::QMorphTarget *target);
- void setWeights(int positionIndex, const QList<float> &weights);
- QList<float> getWeights(int positionIndex);
+ void setWeights(int positionIndex, const QVector<float> &weights);
+ QVector<float> getWeights(int positionIndex);
- QList<Qt3DAnimation::QMorphTarget *> morphTargetList();
+ QVector<Qt3DAnimation::QMorphTarget *> morphTargetList();
public Q_SLOTS:
- void setTargetPositions(const QList<float> &targetPositions);
+ void setTargetPositions(const QVector<float> &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<float> &targetPositions);
+ void targetPositionsChanged(const QVector<float> &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<float> m_targetPositions;
- QList<QList<float>*> m_weights;
- QList<float> m_morphKey;
+ QVector<float> m_targetPositions;
+ QVector<QVector<float>*> m_weights;
+ QVector<float> m_morphKey;
QStringList m_attributeNames;
- QList<Qt3DAnimation::QMorphTarget *> m_morphTargets;
+ QVector<Qt3DAnimation::QMorphTarget *> 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<QFrameChunk> m_chunks;
+ QVector<QFrameChunk> m_chunks;
QFrameChunk *m_lastAllocatedChunck;
QFrameChunk *m_lastFreedChunck;
};
@@ -128,7 +128,7 @@ public:
uint m_maxObjectSize;
uint m_alignment;
- QList<QFixedFrameAllocator> m_allocatorPool;
+ QVector<QFixedFrameAllocator> 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<Sqt> m_localPoses;
- QList<QString> m_jointNames;
+ QVector<Sqt> m_localPoses;
+ QVector<QString> 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<QVector3D> vertices;
- QList<IndexType> indices;
- QList<Outline> outlines;
- QList<IndexType> outlineIndices;
+ QVector<QVector3D> vertices;
+ QVector<IndexType> indices;
+ QVector<Outline> outlines;
+ QVector<IndexType> 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<IndexType> tmpIndices;
+ QVector<IndexType> 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<IndexType> indices;
- QList<Vertex> vertices;
+ QVector<IndexType> indices;
+ QVector<Vertex> 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<float> &vertexData,
- const QList<quint16> &indexData)
+ const QVector<float> &vertexData,
+ const QVector<quint16> &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<float> &vertexData,
- const QList<quint16> &indexData);
+ const QVector<float> &vertexData,
+ const QVector<quint16> &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::Glyph> QDistanceFieldGlyphCache::refGlyphs(const
DistanceFieldFont *dff = getOrCreateDistanceFieldFont(run.rawFont());
QList<QDistanceFieldGlyphCache::Glyph> ret;
- const QList<quint32> 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<quint32> 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<float> vertex;
- QList<quint16> index;
+ QVector<float> vertex;
+ QVector<quint16> index;
};
void QText2DEntityPrivate::setCurrentGlyphRuns(const QList<QGlyphRun> &runs)
@@ -224,8 +224,8 @@ void QText2DEntityPrivate::setCurrentGlyphRuns(const QList<QGlyphRun> &runs)
// process glyph runs
for (const QGlyphRun &run : runs) {
- const QList<quint32> glyphs = run.glyphIndexes();
- const QList<QPointF> 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<float> m_samples;
+ QVector<float> 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<float> dataMat2(4, 0.0f);
- QList<float> dataMat3(9, 0.0f);
+ QVector<float> dataMat2(4, 0.0f);
+ QVector<float> 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 <typename T>
-inline QJsonArray vec2jsvec(const QList<T> &v)
+inline QJsonArray vec2jsvec(const QVector<T> &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<QString, QColor> colors;
QHash<QString, QString> textures;
QHash<QString, QVariant> values;
- QList<int> blendArguments;
- QList<int> blendEquations;
+ QVector<int> blendArguments;
+ QVector<int> 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<QMatrix4x4>(const QList<QMatrix4x4> &v)
+void UniformValue::setData<QMatrix4x4>(const QVector<QMatrix4x4> &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<QMatrix4x4> &v)
+ UniformValue(const QVector<QMatrix4x4> &v)
: m_data(16 * v.size())
{
int offset = 0;
@@ -193,7 +193,7 @@ public:
UniformType storedType() const { return m_storedType; }
template<typename T>
- void setData(const QList<T> &v)
+ void setData(const QVector<T> &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<QMatrix4x4>(const QList<QMatrix4x4> &v);
+Q_3DRENDERSHARED_PRIVATE_EXPORT void UniformValue::setData<QMatrix4x4>(const QVector<QMatrix4x4> &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<BufferData> m_bufferDatas;
- QList<BufferView> m_bufferViews;
- QList<AccessorData> m_accessors;
- QList<Skin> m_skins;
- QList<Node> m_nodes;
+ QVector<BufferData> m_bufferDatas;
+ QVector<BufferView> m_bufferViews;
+ QVector<AccessorData> m_accessors;
+ QVector<Skin> m_skins;
+ QVector<Node> 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<QMatrix4x4> Skeleton::calculateSkinningMatrixPalette()
+QVector<QMatrix4x4> Skeleton::calculateSkinningMatrixPalette()
{
- const QList<Sqt> &localPoses = m_skeletonData.localPoses;
- QList<JointInfo> &joints = m_skeletonData.joints;
+ const QVector<Sqt> &localPoses = m_skeletonData.localPoses;
+ QVector<JointInfo> &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<JointInfo> joints() const { return m_skeletonData.joints; }
- QList<QString> jointNames() const { return m_skeletonData.jointNames; }
- QList<Qt3DCore::Sqt> localPoses() const { return m_skeletonData.localPoses; }
+ QVector<JointInfo> joints() const { return m_skeletonData.joints; }
+ QVector<QString> jointNames() const { return m_skeletonData.jointNames; }
+ QVector<Qt3DCore::Sqt> 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<QMatrix4x4> calculateSkinningMatrixPalette();
+ QVector<QMatrix4x4> calculateSkinningMatrixPalette();
void clearData();
void setSkeletonData(const SkeletonData &data);
@@ -124,7 +124,7 @@ public:
#endif
private:
- QList<QMatrix4x4> m_skinningPalette;
+ QVector<QMatrix4x4> 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<JointInfo> joints;
- QList<Qt3DCore::Sqt> localPoses;
- QList<QString> jointNames;
+ QVector<JointInfo> joints;
+ QVector<Qt3DCore::Sqt> localPoses;
+ QVector<QString> jointNames;
QHash<HJoint, int> 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<QMatrix4x4> skinningPalette = skeleton->calculateSkinningMatrixPalette();
+ const QVector<QMatrix4x4> &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<ChannelMapping *>)
+Q_DECLARE_METATYPE(QVector<ChannelMapping *>)
Q_DECLARE_METATYPE(Clock *)
Q_DECLARE_METATYPE(ChannelMapper *)
Q_DECLARE_METATYPE(AnimationClip *)
-Q_DECLARE_METATYPE(QList<MappingData>)
+Q_DECLARE_METATYPE(QVector<MappingData>)
Q_DECLARE_METATYPE(Channel)
Q_DECLARE_METATYPE(AnimatorEvaluationData)
Q_DECLARE_METATYPE(ClipEvaluationData)
Q_DECLARE_METATYPE(ClipAnimator *)
Q_DECLARE_METATYPE(BlendedClipAnimator *)
-Q_DECLARE_METATYPE(QList<ChannelNameAndType>)
-Q_DECLARE_METATYPE(QList<AnimationCallbackAndValue>)
+Q_DECLARE_METATYPE(QVector<ChannelNameAndType>)
+Q_DECLARE_METATYPE(QVector<AnimationCallbackAndValue>)
Q_DECLARE_METATYPE(ClipFormat)
Q_DECLARE_METATYPE(ChannelNameAndType)
@@ -275,11 +275,11 @@ private Q_SLOTS:
void checkBuildPropertyMappings_data()
{
QTest::addColumn<Handler *>("handler");
- QTest::addColumn<QList<ChannelMapping *>>("channelMappings");
- QTest::addColumn<QList<ChannelNameAndType>>("channelNamesAndTypes");
- QTest::addColumn<QList<ComponentIndices>>("channelComponentIndices");
- QTest::addColumn<QList<QBitArray>>("sourceClipMask");
- QTest::addColumn<QList<MappingData>>("expectedResults");
+ QTest::addColumn<QVector<ChannelMapping *>>("channelMappings");
+ QTest::addColumn<QVector<ChannelNameAndType>>("channelNamesAndTypes");
+ QTest::addColumn<QVector<ComponentIndices>>("channelComponentIndices");
+ QTest::addColumn<QVector<QBitArray>>("sourceClipMask");
+ QTest::addColumn<QVector<MappingData>>("expectedResults");
// Single ChannelMapping
{
@@ -292,7 +292,7 @@ private Q_SLOTS:
static_cast<int>(QMetaType::QVector3D),
3);
- const QList<ChannelMapping *> channelMappings = { channelMapping };
+ const QVector<ChannelMapping *> channelMappings = { channelMapping };
// Create a few channels in the format description
const ChannelNameAndType rotation = { QLatin1String("Rotation"),
@@ -320,7 +320,7 @@ private Q_SLOTS:
5,
channelMapping->peerId() };
const ChannelNameAndType morphTargetWeightsVec = { QLatin1String("MorphTargetWeightsVec"),
- qMetaTypeId<QList<float>>(),
+ qMetaTypeId<QVector<float>>(),
6,
channelMapping->peerId() };
const ChannelNameAndType rgbColor = { QLatin1String("rgbColor"),
@@ -332,7 +332,7 @@ private Q_SLOTS:
4,
channelMapping->peerId() };
- const QList<ChannelNameAndType> channelNamesAndTypes
+ const QVector<ChannelNameAndType> channelNamesAndTypes
= { rotation, location, baseColor, metalness, roughness,
morphTargetWeightsList, morphTargetWeightsVec, rgbColor, rgbaColor };
@@ -346,27 +346,27 @@ private Q_SLOTS:
const ComponentIndices morphTargetVecIndices = { 17, 18, 19, 20, 21, 22 };
const ComponentIndices rgbColorIndices = { 23, 24, 25 };
const ComponentIndices rgbaColorIndices = { 26, 27, 28, 29 };
- const QList<ComponentIndices> channelComponentIndices
+ const QVector<ComponentIndices> channelComponentIndices
= { rotationIndices, locationIndices, baseColorIndices,
metalnessIndices, roughnessIndices, morphTargetListIndices,
morphTargetVecIndices, rgbColorIndices, rgbaColorIndices };
- const QList<QBitArray> sourceClipMask = { QBitArray(4, true),
- QBitArray(3, true),
- QBitArray(3, true),
- QBitArray(1, true),
- QBitArray(1, true),
- QBitArray(5, true),
- QBitArray(6, true),
- QBitArray(3, true),
- QBitArray(4, true) };
+ const QVector<QBitArray> sourceClipMask = { QBitArray(4, true),
+ QBitArray(3, true),
+ QBitArray(3, true),
+ QBitArray(1, true),
+ QBitArray(1, true),
+ QBitArray(5, true),
+ QBitArray(6, true),
+ QBitArray(3, true),
+ QBitArray(4, true) };
MappingData expectedMapping;
expectedMapping.targetId = channelMapping->targetId();
expectedMapping.propertyName = channelMapping->propertyName();
expectedMapping.type = channelMapping->type();
expectedMapping.channelIndices = locationIndices;
- const QList<MappingData> expectedResults = { expectedMapping };
+ const QVector<MappingData> expectedResults = { expectedMapping };
QTest::newRow("single mapping")
<< handler
@@ -424,7 +424,7 @@ private Q_SLOTS:
5);
- const QList<ChannelMapping *> channelMappings
+ const QVector<ChannelMapping *> channelMappings
= { locationMapping, metalnessMapping,
baseColorMapping, roughnessMapping,
rotationMapping, morphTargetMapping };
@@ -454,7 +454,7 @@ private Q_SLOTS:
static_cast<int>(QMetaType::QVariantList),
5,
morphTargetMapping->peerId() };
- const QList<ChannelNameAndType> channelNamesAndTypes
+ const QVector<ChannelNameAndType> channelNamesAndTypes
= { rotation, location, baseColor, metalness, roughness,
morphTarget };
@@ -465,16 +465,16 @@ private Q_SLOTS:
const ComponentIndices metalnessIndices = { 10 };
const ComponentIndices roughnessIndices = { 11 };
const ComponentIndices morphTargetIndices = { 12, 13, 14, 15, 16 };
- const QList<ComponentIndices> channelComponentIndices
+ const QVector<ComponentIndices> channelComponentIndices
= { rotationIndices, locationIndices, baseColorIndices,
metalnessIndices, roughnessIndices, morphTargetIndices };
- const QList<QBitArray> sourceClipMask = { QBitArray(4, true),
- QBitArray(3, true),
- QBitArray(3, true),
- QBitArray(1, true),
- QBitArray(1, true),
- QBitArray(5, true) };
+ const QVector<QBitArray> sourceClipMask = { QBitArray(4, true),
+ QBitArray(3, true),
+ QBitArray(3, true),
+ QBitArray(1, true),
+ QBitArray(1, true),
+ QBitArray(5, true) };
MappingData expectedLocationMapping;
expectedLocationMapping.targetId = locationMapping->targetId();
@@ -512,7 +512,7 @@ private Q_SLOTS:
expectedMorphTargetMapping.type = morphTargetMapping->type();
expectedMorphTargetMapping.channelIndices = morphTargetIndices;
- const QList<MappingData> expectedResults
+ const QVector<MappingData> expectedResults
= { expectedLocationMapping,
expectedMetalnessMapping,
expectedBaseColorMapping,
@@ -536,10 +536,10 @@ private Q_SLOTS:
auto skeleton = createSkeleton(handler, jointCount);
auto channelMapping = createChannelMapping(handler, skeleton->peerId());
- const QList<ChannelMapping *> channelMappings = { channelMapping };
+ const QVector<ChannelMapping *> channelMappings = { channelMapping };
// Create a few channels in the format description
- QList<ChannelNameAndType> channelNamesAndTypes;
+ QVector<ChannelNameAndType> channelNamesAndTypes;
for (int i = 0; i < jointCount; ++i) {
ChannelNameAndType locationDescription = { QLatin1String("Location"),
static_cast<int>(QMetaType::QVector3D),
@@ -567,27 +567,27 @@ private Q_SLOTS:
}
// And the matching indices
- const QList<ComponentIndices> channelComponentIndices = {
+ const QVector<ComponentIndices> channelComponentIndices = {
{ 0, 1, 2 }, { 3, 4, 5, 6 }, { 7, 8, 9 },
{ 10, 11, 12 }, { 13, 14, 15, 16 }, { 17, 18, 19 },
{ 20, 21, 22 }, { 23, 24, 25, 26 }, { 27, 28, 29 },
{ 30, 31, 32 }, { 33, 34, 35, 36 }, { 37, 38, 39 }
};
- const QList<QBitArray> sourceClipMask = { QBitArray(3, true),
- QBitArray(4, true),
- QBitArray(3, true),
- QBitArray(3, true),
- QBitArray(4, true),
- QBitArray(3, true),
- QBitArray(3, true),
- QBitArray(4, true),
- QBitArray(3, true),
- QBitArray(3, true),
- QBitArray(4, true),
- QBitArray(3, true) };
-
- QList<MappingData> expectedResults;
+ const QVector<QBitArray> sourceClipMask = { QBitArray(3, true),
+ QBitArray(4, true),
+ QBitArray(3, true),
+ QBitArray(3, true),
+ QBitArray(4, true),
+ QBitArray(3, true),
+ QBitArray(3, true),
+ QBitArray(4, true),
+ QBitArray(3, true),
+ QBitArray(3, true),
+ QBitArray(4, true),
+ QBitArray(3, true) };
+
+ QVector<MappingData> expectedResults;
int componentIndicesIndex = 0;
for (int i = 0; i < jointCount; ++i) {
MappingData locationMapping;
@@ -628,17 +628,17 @@ private Q_SLOTS:
{
// GIVEN
QFETCH(Handler *, handler);
- QFETCH(QList<ChannelMapping *>, channelMappings);
- QFETCH(QList<ChannelNameAndType>, channelNamesAndTypes);
- QFETCH(QList<ComponentIndices>, channelComponentIndices);
- QFETCH(QList<QBitArray>, sourceClipMask);
- QFETCH(QList<MappingData>, expectedResults);
+ QFETCH(QVector<ChannelMapping *>, channelMappings);
+ QFETCH(QVector<ChannelNameAndType>, channelNamesAndTypes);
+ QFETCH(QVector<ComponentIndices>, channelComponentIndices);
+ QFETCH(QVector<QBitArray>, sourceClipMask);
+ QFETCH(QVector<MappingData>, expectedResults);
// WHEN
- const QList<MappingData> actualResults = buildPropertyMappings(channelMappings,
- channelNamesAndTypes,
- channelComponentIndices,
- sourceClipMask);
+ const auto actualResults = buildPropertyMappings(channelMappings,
+ channelNamesAndTypes,
+ channelComponentIndices,
+ sourceClipMask);
// THEN
QCOMPARE(actualResults.size(), expectedResults.size());
@@ -794,13 +794,13 @@ private Q_SLOTS:
void checkPreparePropertyChanges_data()
{
QTest::addColumn<Qt3DCore::QNodeId>("animatorId");
- QTest::addColumn<QList<MappingData>>("mappingData");
- QTest::addColumn<QList<float>>("channelResults");
+ QTest::addColumn<QVector<MappingData>>("mappingData");
+ QTest::addColumn<QVector<float>>("channelResults");
QTest::addColumn<AnimationRecord>("expectedChanges");
Qt3DCore::QNodeId animatorId;
- QList<MappingData> mappingData;
- QList<float> channelResults;
+ QVector<MappingData> mappingData;
+ QVector<float> channelResults;
AnimationRecord expectedChanges;
// Single property, vec3
@@ -810,9 +810,9 @@ private Q_SLOTS:
mapping.targetId = Qt3DCore::QNodeId::createId();
mapping.propertyName = "translation";
mapping.type = static_cast<int>(QMetaType::QVector3D);
- mapping.channelIndices = QList<int> { 0, 1, 2 };
+ mapping.channelIndices = QVector<int> { 0, 1, 2 };
mappingData.push_back(mapping);
- channelResults = QList<float> { 1.0f, 2.0f, 3.0f };
+ channelResults = QVector<float> { 1.0f, 2.0f, 3.0f };
expectedChanges.normalizedTime = 1.1f; // Invalid
expectedChanges.finalFrame = false;
expectedChanges.targetChanges.push_back({mapping.targetId, mapping.propertyName, QVariant::fromValue(QVector3D(1.0f, 2.0f, 3.0f))});
@@ -838,17 +838,17 @@ private Q_SLOTS:
translationMapping.targetId = Qt3DCore::QNodeId::createId();
translationMapping.propertyName = "translation";
translationMapping.type = static_cast<int>(QMetaType::QVector3D);
- translationMapping.channelIndices = QList<int> { 0, 1, 2 };
+ translationMapping.channelIndices = QVector<int> { 0, 1, 2 };
mappingData.push_back(translationMapping);
MappingData scaleMapping;
scaleMapping.targetId = Qt3DCore::QNodeId::createId();
scaleMapping.propertyName = "scale";
scaleMapping.type = static_cast<int>(QMetaType::QVector3D);
- scaleMapping.channelIndices = QList<int> { 3, 4, 5 };
+ scaleMapping.channelIndices = QVector<int> { 3, 4, 5 };
mappingData.push_back(scaleMapping);
- channelResults = QList<float> { 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f };
+ channelResults = QVector<float> { 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f };
expectedChanges.finalFrame = false;
expectedChanges.normalizedTime = -0.1f; // Invalid
@@ -876,9 +876,9 @@ private Q_SLOTS:
mapping.targetId = Qt3DCore::QNodeId::createId();
mapping.propertyName = "mass";
mapping.type = static_cast<int>(QMetaType::Double);
- mapping.channelIndices = QList<int> { 0 };
+ mapping.channelIndices = QVector<int> { 0 };
mappingData.push_back(mapping);
- channelResults = QList<float> { 3.5f };
+ channelResults = QVector<float> { 3.5f };
expectedChanges.finalFrame = false;
expectedChanges.normalizedTime = -1.0f; // Invalid
expectedChanges.targetChanges.push_back({mapping.targetId, mapping.propertyName, QVariant::fromValue(3.5f)});
@@ -898,9 +898,9 @@ private Q_SLOTS:
mapping.targetId = Qt3DCore::QNodeId::createId();
mapping.propertyName = "pos";
mapping.type = static_cast<int>(QMetaType::QVector2D);
- mapping.channelIndices = QList<int> { 0, 1 };
+ mapping.channelIndices = QVector<int> { 0, 1 };
mappingData.push_back(mapping);
- channelResults = QList<float> { 2.0f, 1.0f };
+ channelResults = QVector<float> { 2.0f, 1.0f };
expectedChanges.finalFrame = false;
expectedChanges.normalizedTime = 1.1f; // Invalid
expectedChanges.targetChanges.push_back({mapping.targetId, mapping.propertyName, QVariant::fromValue(QVector2D(2.0f, 1.0f))});
@@ -920,9 +920,9 @@ private Q_SLOTS:
mapping.targetId = Qt3DCore::QNodeId::createId();
mapping.propertyName = "foo";
mapping.type = static_cast<int>(QMetaType::QVector4D);
- mapping.channelIndices = QList<int> { 0, 1, 2, 3 };
+ mapping.channelIndices = QVector<int> { 0, 1, 2, 3 };
mappingData.push_back(mapping);
- channelResults = QList<float> { 4.0f, 3.0f, 2.0f, 1.0f };
+ channelResults = QVector<float> { 4.0f, 3.0f, 2.0f, 1.0f };
expectedChanges.finalFrame = false;
expectedChanges.normalizedTime = 1.1f; // Invalid
expectedChanges.targetChanges.push_back({mapping.targetId, mapping.propertyName, QVariant::fromValue(QVector4D(4.0f, 3.0f, 2.0f, 1.0f))});
@@ -942,9 +942,9 @@ private Q_SLOTS:
mapping.targetId = Qt3DCore::QNodeId::createId();
mapping.propertyName = "rotation";
mapping.type = static_cast<int>(QMetaType::QQuaternion);
- mapping.channelIndices = QList<int> { 0, 1, 2, 3 };
+ mapping.channelIndices = QVector<int> { 0, 1, 2, 3 };
mappingData.push_back(mapping);
- channelResults = QList<float> { 1.0f, 0.0f, 0.0f, 1.0f };
+ channelResults = QVector<float> { 1.0f, 0.0f, 0.0f, 1.0f };
expectedChanges.finalFrame = false;
expectedChanges.normalizedTime = -0.1f; // Invalid
expectedChanges.targetChanges.push_back({mapping.targetId, mapping.propertyName, QVariant::fromValue(QQuaternion(1.0f, 0.0f, 0.0f, 1.0f).normalized())});
@@ -964,9 +964,9 @@ private Q_SLOTS:
mapping.targetId = Qt3DCore::QNodeId::createId();
mapping.propertyName = "color";
mapping.type = static_cast<int>(QMetaType::QColor);
- mapping.channelIndices = QList<int> { 0, 1, 2 };
+ mapping.channelIndices = QVector<int> { 0, 1, 2 };
mappingData.push_back(mapping);
- channelResults = QList<float> { 0.5f, 0.4f, 0.3f };
+ channelResults = QVector<float> { 0.5f, 0.4f, 0.3f };
expectedChanges.finalFrame = false;
expectedChanges.normalizedTime = 1.1f; // Invalid
expectedChanges.targetChanges.push_back({mapping.targetId, mapping.propertyName, QVariant::fromValue(QColor::fromRgbF(0.5f, 0.4f, 0.3f))});
@@ -986,9 +986,9 @@ private Q_SLOTS:
mapping.targetId = Qt3DCore::QNodeId::createId();
mapping.propertyName = "color";
mapping.type = static_cast<int>(QMetaType::QColor);
- mapping.channelIndices = QList<int> { 0, 1, 2, 3 };
+ mapping.channelIndices = QVector<int> { 0, 1, 2, 3 };
mappingData.push_back(mapping);
- channelResults = QList<float> { 0.5f, 0.4f, 0.3f, 0.2f };
+ channelResults = QVector<float> { 0.5f, 0.4f, 0.3f, 0.2f };
expectedChanges.finalFrame = false;
expectedChanges.normalizedTime = 1.1f; // Invalid
expectedChanges.targetChanges.push_back({mapping.targetId, mapping.propertyName, QVariant::fromValue(QColor::fromRgbF(0.5f, 0.4f, 0.3f, 0.2f))});
@@ -1008,9 +1008,9 @@ private Q_SLOTS:
mapping.targetId = Qt3DCore::QNodeId::createId();
mapping.propertyName = "weights";
mapping.type = static_cast<int>(QMetaType::QVariantList);
- mapping.channelIndices = QList<int> { 0, 1, 2, 3, 4, 5, 6 };
+ mapping.channelIndices = QVector<int> { 0, 1, 2, 3, 4, 5, 6 };
mappingData.push_back(mapping);
- channelResults = QList<float> { 0.5f, 0.4f, 0.3f, 0.0f, 1.0f, 0.6f, 0.9f };
+ channelResults = QVector<float> { 0.5f, 0.4f, 0.3f, 0.0f, 1.0f, 0.6f, 0.9f };
expectedChanges.finalFrame = false;
expectedChanges.normalizedTime = 1.1f; // Invalid
QVariantList expectedValue = QVariantList { 0.5f, 0.4f, 0.3f, 0.0f, 1.0f, 0.6f, 0.9f };
@@ -1030,8 +1030,8 @@ private Q_SLOTS:
{
// GIVEN
QFETCH(Qt3DCore::QNodeId, animatorId);
- QFETCH(QList<MappingData>, mappingData);
- QFETCH(QList<float>, channelResults);
+ QFETCH(QVector<MappingData>, mappingData);
+ QFETCH(QVector<float>, channelResults);
QFETCH(AnimationRecord, expectedChanges);
// WHEN
@@ -1052,13 +1052,13 @@ private Q_SLOTS:
void checkPrepareCallbacks_data()
{
- QTest::addColumn<QList<MappingData>>("mappingData");
- QTest::addColumn<QList<float>>("channelResults");
- QTest::addColumn<QList<AnimationCallbackAndValue> >("expectedValues");
+ QTest::addColumn<QVector<MappingData>>("mappingData");
+ QTest::addColumn<QVector<float>>("channelResults");
+ QTest::addColumn<QVector<AnimationCallbackAndValue> >("expectedValues");
- QList<MappingData> mappingData;
- QList<float> channelResults;
- QList<AnimationCallbackAndValue> expectedValues;
+ QVector<MappingData> mappingData;
+ QVector<float> channelResults;
+ QVector<AnimationCallbackAndValue> expectedValues;
// vec3
{
@@ -1067,11 +1067,11 @@ private Q_SLOTS:
mapping.targetId = Qt3DCore::QNodeId::createId();
mapping.propertyName = "translation";
mapping.type = static_cast<int>(QMetaType::QVector3D);
- mapping.channelIndices = QList<int> { 0, 1, 2 };
+ mapping.channelIndices = QVector<int> { 0, 1, 2 };
mapping.callback = &callback;
mapping.callbackFlags = {};
mappingData.push_back(mapping);
- channelResults = QList<float> { 1.0f, 2.0f, 3.0f };
+ channelResults = QVector<float> { 1.0f, 2.0f, 3.0f };
AnimationCallbackAndValue cbv;
cbv.callback = mapping.callback;
@@ -1093,11 +1093,11 @@ private Q_SLOTS:
mapping.targetId = Qt3DCore::QNodeId::createId();
mapping.propertyName = "something";
mapping.type = static_cast<int>(QMetaType::Double);
- mapping.channelIndices = QList<int> { 0 };
+ mapping.channelIndices = QVector<int> { 0 };
mapping.callback = &callback;
mapping.callbackFlags = {};
mappingData.push_back(mapping);
- channelResults = QList<float> { 1.0f };
+ channelResults = QVector<float> { 1.0f };
AnimationCallbackAndValue cbv;
cbv.callback = mapping.callback;
@@ -1119,11 +1119,11 @@ private Q_SLOTS:
mapping.targetId = Qt3DCore::QNodeId::createId();
mapping.propertyName = "opacity";
mapping.type = static_cast<int>(QMetaType::Float);
- mapping.channelIndices = QList<int> { 0 };
+ mapping.channelIndices = QVector<int> { 0 };
mapping.callback = &callback;
mapping.callbackFlags = Qt3DAnimation::QAnimationCallback::OnThreadPool;
mappingData.push_back(mapping);
- channelResults = QList<float> { 0.5f };
+ channelResults = QVector<float> { 0.5f };
AnimationCallbackAndValue cbv;
cbv.callback = mapping.callback;
@@ -1142,12 +1142,12 @@ private Q_SLOTS:
void checkPrepareCallbacks()
{
// GIVEN
- QFETCH(QList<MappingData>, mappingData);
- QFETCH(QList<float>, channelResults);
- QFETCH(QList<AnimationCallbackAndValue>, expectedValues);
+ QFETCH(QVector<MappingData>, mappingData);
+ QFETCH(QVector<float>, channelResults);
+ QFETCH(QVector<AnimationCallbackAndValue>, expectedValues);
// WHEN
- QList<AnimationCallbackAndValue> callbacks = prepareCallbacks(mappingData, channelResults);
+ QVector<AnimationCallbackAndValue> callbacks = prepareCallbacks(mappingData, channelResults);
// THEN
QCOMPARE(callbacks.size(), expectedValues.size());
@@ -1177,7 +1177,7 @@ private Q_SLOTS:
handler = new Handler();
clip = createAnimationClipLoader(handler, QUrl("qrc:/clip1.json"));
localTime = 0.0f;
- expectedResults = QList<float> { 0.0f, 0.0f, 0.0f };
+ expectedResults = QVector<float> { 0.0f, 0.0f, 0.0f };
QTest::newRow("clip1.json, t = 0.0")
<< handler << clip << localTime << expectedResults;
@@ -1188,7 +1188,7 @@ private Q_SLOTS:
handler = new Handler();
clip = createAnimationClipLoader(handler, QUrl("qrc:/clip1.json"));
localTime = clip->duration();
- expectedResults = QList<float> { 5.0f, 0.0f, 0.0f };
+ expectedResults = QVector<float> { 5.0f, 0.0f, 0.0f };
QTest::newRow("clip1.json, t = duration")
<< handler << clip << localTime << expectedResults;
@@ -1199,7 +1199,7 @@ private Q_SLOTS:
handler = new Handler();
clip = createAnimationClipLoader(handler, QUrl("qrc:/clip1.json"));
localTime = clip->duration() / 2.0f;
- expectedResults = QList<float> { 2.5f, 0.0f, 0.0f };
+ expectedResults = QVector<float> { 2.5f, 0.0f, 0.0f };
QTest::newRow("clip1.json, t = duration/2")
<< handler << clip << localTime << expectedResults;
@@ -1210,7 +1210,7 @@ private Q_SLOTS:
handler = new Handler();
clip = createAnimationClipLoader(handler, QUrl("qrc:/clip2.json"));
localTime = 0.0f;
- expectedResults = QList<float> { 0.0f, 0.0f, 0.0f, // Translation
+ expectedResults = QVector<float> { 0.0f, 0.0f, 0.0f, // Translation
1.0f, 0.0f, 0.0f, 0.0f }; // Rotation
QTest::newRow("clip2.json, t = 0.0")
@@ -1221,7 +1221,7 @@ private Q_SLOTS:
handler = new Handler();
clip = createAnimationClipLoader(handler, QUrl("qrc:/clip2.json"));
localTime = clip->duration();
- expectedResults = QList<float> { 5.0f, 0.0f, 0.0f, // Translation
+ expectedResults = QVector<float> { 5.0f, 0.0f, 0.0f, // Translation
0.0f, 0.0f, -1.0f, 0.0f }; // Rotation
QTest::newRow("clip2.json, t = duration")
@@ -1232,7 +1232,7 @@ private Q_SLOTS:
handler = new Handler();
clip = createAnimationClipLoader(handler, QUrl("qrc:/clip2.json"));
localTime = clip->duration() / 2.0f;
- expectedResults = QList<float> { 2.5f, 0.0f, 0.0f, // Translation
+ expectedResults = QVector<float> { 2.5f, 0.0f, 0.0f, // Translation
0.5f, 0.0f, -0.5f, 0.0f }; // Rotation
QTest::newRow("clip2.json, t = duration/2")
@@ -1244,7 +1244,7 @@ private Q_SLOTS:
handler = new Handler();
clip = createAnimationClipLoader(handler, QUrl("qrc:/clip4.json"));
localTime = clip->duration();
- expectedResults = QList<float> { 5.0, -2.0f, 6.0f };
+ expectedResults = QVector<float> { 5.0, -2.0f, 6.0f };
QTest::newRow("clip4.json, linear, t = duration")
<< handler << clip << localTime << expectedResults;
@@ -1255,7 +1255,7 @@ private Q_SLOTS:
handler = new Handler();
clip = createAnimationClipLoader(handler, QUrl("qrc:/clip4.json"));
localTime = clip->duration() / 2.0f;
- expectedResults = QList<float> { 2.5f, -1.0f, 3.0f };
+ expectedResults = QVector<float> { 2.5f, -1.0f, 3.0f };
QTest::newRow("clip4.json, linear, t = duration/2")
<< handler << clip << localTime << expectedResults;
@@ -1266,7 +1266,7 @@ private Q_SLOTS:
handler = new Handler();
clip = createAnimationClipLoader(handler, QUrl("qrc:/clip6.json"));
localTime = clip->duration() / 2.0f;
- expectedResults = QList<float> { 0.923822f, 0.382626f, 0.0f, 0.0f };
+ expectedResults = QVector<float> { 0.923822f, 0.382626f, 0.0f, 0.0f };
QTest::newRow("clip6.json, slerp, t = duration/2")
<< handler << clip << localTime << expectedResults;
@@ -1314,7 +1314,7 @@ private Q_SLOTS:
handler = new Handler();
clip = createAnimationClipLoader(handler, QUrl("qrc:/clip1.json"));
phase = 0.0f;
- expectedResults = QList<float> { 0.0f, 0.0f, 0.0f };
+ expectedResults = QVector<float> { 0.0f, 0.0f, 0.0f };
QTest::newRow("clip1.json, phi = 0.0")
<< handler << clip << phase << expectedResults;
@@ -1325,7 +1325,7 @@ private Q_SLOTS:
handler = new Handler();
clip = createAnimationClipLoader(handler, QUrl("qrc:/clip1.json"));
phase = 1.0f;
- expectedResults = QList<float> { 5.0f, 0.0f, 0.0f };
+ expectedResults = QVector<float> { 5.0f, 0.0f, 0.0f };
QTest::newRow("clip1.json, phi = 1.0")
<< handler << clip << phase << expectedResults;
@@ -1336,7 +1336,7 @@ private Q_SLOTS:
handler = new Handler();
clip = createAnimationClipLoader(handler, QUrl("qrc:/clip1.json"));
phase = 0.5f;
- expectedResults = QList<float> { 2.5f, 0.0f, 0.0f };
+ expectedResults = QVector<float> { 2.5f, 0.0f, 0.0f };
QTest::newRow("clip1.json, phi = 0.5")
<< handler << clip << phase << expectedResults;
@@ -1347,7 +1347,7 @@ private Q_SLOTS:
handler = new Handler();
clip = createAnimationClipLoader(handler, QUrl("qrc:/clip2.json"));
phase = 0.0f;
- expectedResults = QList<float> { 0.0f, 0.0f, 0.0f, // Translation
+ expectedResults = QVector<float> { 0.0f, 0.0f, 0.0f, // Translation
1.0f, 0.0f, 0.0f, 0.0f }; // Rotation
QTest::newRow("clip2.json, phi = 0.0")
@@ -1358,7 +1358,7 @@ private Q_SLOTS:
handler = new Handler();
clip = createAnimationClipLoader(handler, QUrl("qrc:/clip2.json"));
phase = 1.0f;
- expectedResults = QList<float> { 5.0f, 0.0f, 0.0f, // Translation
+ expectedResults = QVector<float> { 5.0f, 0.0f, 0.0f, // Translation
0.0f, 0.0f, -1.0f, 0.0f }; // Rotation
QTest::newRow("clip2.json, t = 1.0")
@@ -1369,7 +1369,7 @@ private Q_SLOTS:
handler = new Handler();
clip = createAnimationClipLoader(handler, QUrl("qrc:/clip2.json"));
phase = 0.5f;
- expectedResults = QList<float> { 2.5f, 0.0f, 0.0f, // Translation
+ expectedResults = QVector<float> { 2.5f, 0.0f, 0.0f, // Translation
0.5f, 0.0f, -0.5f, 0.0f }; // Rotation
QTest::newRow("clip2.json, phi = 0.5")
@@ -1759,8 +1759,8 @@ private Q_SLOTS:
QFETCH(QList<int>, expectedResults);
// WHEN
- const QList<int> actualResults = channelComponentsToIndicesHelper(channel,
- expectedChannelComponentCount, offset, suffixes);
+ const QVector<int> actualResults = channelComponentsToIndicesHelper(channel,
+ expectedChannelComponentCount, offset, suffixes);
// THEN
QCOMPARE(actualResults.size(), expectedResults.size());
@@ -1902,8 +1902,8 @@ private Q_SLOTS:
QFETCH(QList<int>, expectedResults);
// WHEN
- const QList<int> actualResults = channelComponentsToIndices(channel,
- dataType, componentCount, offset);
+ const QVector<int> actualResults = channelComponentsToIndices(channel,
+ dataType, componentCount, offset);
// THEN
QCOMPARE(actualResults.size(), expectedResults.size());
@@ -2308,7 +2308,7 @@ private Q_SLOTS:
QFETCH(QList<Qt3DCore::QNodeId>, expectedIds);
// WHEN
- const QList<Qt3DCore::QNodeId> actualIds = gatherValueNodesToEvaluate(handler, blendTreeRootId);
+ const QVector<Qt3DCore::QNodeId> actualIds = gatherValueNodesToEvaluate(handler, blendTreeRootId);
// THEN
QCOMPARE(actualIds.size(), expectedIds.size());
@@ -2797,7 +2797,7 @@ private Q_SLOTS:
QFETCH(QList<ChannelNameAndType>, expectedResults);
// WHEN
- const QList<ChannelNameAndType> actualResults = buildRequiredChannelsAndTypes(handler, mapper);
+ const QVector<ChannelNameAndType> actualResults = buildRequiredChannelsAndTypes(handler, mapper);
// THEN
QCOMPARE(actualResults.size(), expectedResults.size());
@@ -2810,33 +2810,33 @@ private Q_SLOTS:
void checkAssignChannelComponentIndices_data()
{
- QTest::addColumn<QList<ChannelNameAndType>>("allChannels");
- QTest::addColumn<QList<ComponentIndices>>("expectedResults");
+ QTest::addColumn<QVector<ChannelNameAndType>>("allChannels");
+ QTest::addColumn<QVector<ComponentIndices>>("expectedResults");
{
- const QList<ChannelNameAndType> allChannels = {
+ const QVector<ChannelNameAndType> allChannels = {
{ QLatin1String("Location"), static_cast<int>(QMetaType::QVector3D), 3 }
};
- const QList<ComponentIndices> expectedResults = { { 0, 1, 2 } };
+ const QVector<ComponentIndices> expectedResults = { { 0, 1, 2 } };
QTest::newRow("vec3 location") << allChannels << expectedResults;
}
{
- const QList<ChannelNameAndType> allChannels = {
+ const QVector<ChannelNameAndType> allChannels = {
{ QLatin1String("Location"), static_cast<int>(QMetaType::QVector3D), 3 },
{ QLatin1String("Rotation"), static_cast<int>(QMetaType::QQuaternion), 4 }
};
- const QList<ComponentIndices> expectedResults = { { 0, 1, 2 },
+ const QVector<ComponentIndices> expectedResults = { { 0, 1, 2 },
{ 3, 4, 5, 6 } };
QTest::newRow("vec3 location, quaterion rotation") << allChannels << expectedResults;
}
{
- const QList<ChannelNameAndType> allChannels = {
+ const QVector<ChannelNameAndType> allChannels = {
{ QLatin1String("Location"), static_cast<int>(QMetaType::QVector3D), 3 },
{ QLatin1String("Rotation"), static_cast<int>(QMetaType::QQuaternion), 4 },
{ QLatin1String("BaseColor"), static_cast<int>(QMetaType::QVector3D), 3 },
@@ -2845,7 +2845,7 @@ private Q_SLOTS:
{ QLatin1String("MorphWeights"), static_cast<int>(QMetaType::QVariantList), 6 }
};
- const QList<ComponentIndices> expectedResults = {
+ const QVector<ComponentIndices> expectedResults = {
{ 0, 1, 2 },
{ 3, 4, 5, 6 },
{ 7, 8, 9 },
@@ -2857,7 +2857,7 @@ private Q_SLOTS:
}
{
- QList<ChannelNameAndType> allChannels;
+ QVector<ChannelNameAndType> allChannels;
const int jointCount = 4;
for (int i = 0; i < jointCount; ++i) {
ChannelNameAndType locationDescription = { QLatin1String("Location"), static_cast<int>(QMetaType::QVector3D), 3 };
@@ -2873,7 +2873,7 @@ private Q_SLOTS:
allChannels.push_back(scaleDescription);
}
- const QList<ComponentIndices> expectedResults = {
+ const QVector<ComponentIndices> expectedResults = {
{ 0, 1, 2 }, { 3, 4, 5, 6 }, { 7, 8, 9 },
{ 10, 11, 12 }, { 13, 14, 15, 16 }, { 17, 18, 19 },
{ 20, 21, 22 }, { 23, 24, 25, 26 }, { 27, 28, 29 },
@@ -2887,11 +2887,11 @@ private Q_SLOTS:
void checkAssignChannelComponentIndices()
{
// GIVEN
- QFETCH(QList<ChannelNameAndType>, allChannels);
- QFETCH(QList<ComponentIndices>, expectedResults);
+ QFETCH(QVector<ChannelNameAndType>, allChannels);
+ QFETCH(QVector<ComponentIndices>, expectedResults);
// WHEN
- const QList<ComponentIndices> actualResults = assignChannelComponentIndices(allChannels);
+ const QVector<ComponentIndices> actualResults = assignChannelComponentIndices(allChannels);
// THEN
QCOMPARE(actualResults.size(), expectedResults.size());
@@ -2906,13 +2906,13 @@ private Q_SLOTS:
void checkGenerateClipFormatIndices_data()
{
- QTest::addColumn<QList<ChannelNameAndType>>("targetChannels");
- QTest::addColumn<QList<ComponentIndices>>("targetIndices");
+ QTest::addColumn<QVector<ChannelNameAndType>>("targetChannels");
+ QTest::addColumn<QVector<ComponentIndices>>("targetIndices");
QTest::addColumn<AnimationClip *>("clip");
QTest::addColumn<ClipFormat>("expectedResults");
{
- const QList<ChannelNameAndType> targetChannels = {
+ const QVector<ChannelNameAndType> targetChannels = {
{ QLatin1String("Rotation"), static_cast<int>(QMetaType::QQuaternion), 4 },
{ QLatin1String("Location"), static_cast<int>(QMetaType::QVector3D), 3 },
{ QLatin1String("Base Color"), static_cast<int>(QMetaType::QVector3D), 3 },
@@ -2920,7 +2920,7 @@ private Q_SLOTS:
{ QLatin1String("Roughness"), static_cast<int>(QMetaType::Double), 1 }
};
- const QList<ComponentIndices> targetIndices = {
+ const QVector<ComponentIndices> targetIndices = {
{ 0, 1, 2, 3 },
{ 4, 5, 6 },
{ 7, 8, 9 },
@@ -2952,7 +2952,7 @@ private Q_SLOTS:
}
{
- const QList<ChannelNameAndType> targetChannels = {
+ const QVector<ChannelNameAndType> targetChannels = {
{ QLatin1String("Location"), static_cast<int>(QMetaType::QVector3D), 3 },
{ QLatin1String("Rotation"), static_cast<int>(QMetaType::QQuaternion), 4 },
{ QLatin1String("Base Color"), static_cast<int>(QMetaType::QVector3D), 3 },
@@ -2960,7 +2960,7 @@ private Q_SLOTS:
{ QLatin1String("Roughness"), static_cast<int>(QMetaType::Double), 1 }
};
- const QList<ComponentIndices> targetIndices = {
+ const QVector<ComponentIndices> targetIndices = {
{ 0, 1, 2 },
{ 3, 4, 5, 6 },
{ 7, 8, 9 },
@@ -2992,7 +2992,7 @@ private Q_SLOTS:
}
{
- const QList<ChannelNameAndType> targetChannels = {
+ const QVector<ChannelNameAndType> targetChannels = {
{ QLatin1String("Rotation"), static_cast<int>(QMetaType::QQuaternion), 4 },
{ QLatin1String("Location"), static_cast<int>(QMetaType::QVector3D), 3 },
{ QLatin1String("Albedo"), static_cast<int>(QMetaType::QVector3D), 3 },
@@ -3000,7 +3000,7 @@ private Q_SLOTS:
{ QLatin1String("Roughness"), static_cast<int>(QMetaType::Double), 1 }
};
- const QList<ComponentIndices> targetIndices = {
+ const QVector<ComponentIndices> targetIndices = {
{ 0, 1, 2, 3 },
{ 4, 5, 6 },
{ 7, 8, 9 },
@@ -3032,7 +3032,7 @@ private Q_SLOTS:
}
{
- const QList<ChannelNameAndType> targetChannels = {
+ const QVector<ChannelNameAndType> targetChannels = {
{ QLatin1String("Location"), static_cast<int>(QMetaType::QVector3D), 3 },
{ QLatin1String("Rotation"), static_cast<int>(QMetaType::QQuaternion), 4 },
{ QLatin1String("Albedo"), static_cast<int>(QMetaType::QVector3D), 3 },
@@ -3040,7 +3040,7 @@ private Q_SLOTS:
{ QLatin1String("Roughness"), static_cast<int>(QMetaType::Double), 1 }
};
- const QList<ComponentIndices> targetIndices = {
+ const QVector<ComponentIndices> targetIndices = {
{ 0, 1, 2 },
{ 3, 4, 5, 6 },
{ 7, 8, 9 },
@@ -3072,7 +3072,7 @@ private Q_SLOTS:
}
{
- QList<ChannelNameAndType> targetChannels;
+ QVector<ChannelNameAndType> targetChannels;
const int jointCount = 4;
for (int i = 0; i < jointCount; ++i) {
ChannelNameAndType locationDescription = { QLatin1String("Location"), static_cast<int>(QMetaType::QVector3D), 3 };
@@ -3088,7 +3088,7 @@ private Q_SLOTS:
targetChannels.push_back(scaleDescription);
}
- const QList<ComponentIndices> targetIndices = {
+ const QVector<ComponentIndices> targetIndices = {
{ 0, 1, 2 }, { 3, 4, 5, 6 }, { 7, 8, 9 },
{ 10, 11, 12 }, { 13, 14, 15, 16 }, { 17, 18, 19 },
{ 20, 21, 22 }, { 23, 24, 25, 26 }, { 27, 28, 29 },
@@ -3136,8 +3136,8 @@ private Q_SLOTS:
void checkGenerateClipFormatIndices()
{
// GIVEN
- QFETCH(QList<ChannelNameAndType>, targetChannels);
- QFETCH(QList<ComponentIndices>, targetIndices);
+ QFETCH(QVector<ChannelNameAndType>, targetChannels);
+ QFETCH(QVector<ComponentIndices>, targetIndices);
QFETCH(AnimationClip *, clip);
QFETCH(ClipFormat, expectedResults);
@@ -3171,7 +3171,7 @@ private Q_SLOTS:
{
QTest::addColumn<Handler *>("handler");
QTest::addColumn<ChannelNameAndType>("channelDescription");
- QTest::addColumn<QList<float>>("expectedResults");
+ QTest::addColumn<QVector<float>>("expectedResults");
{
auto handler = new Handler();
@@ -3185,7 +3185,7 @@ private Q_SLOTS:
channelDescription.mappingId = channelMapping->peerId();
channelDescription.type = static_cast<int>(QMetaType::QVector3D);
channelDescription.name = QLatin1String("translation");
- const QList<float> expectedResults = { 0.0f, 0.0f, 0.0f };
+ const QVector<float> expectedResults = { 0.0f, 0.0f, 0.0f };
QTest::newRow("translation") << handler << channelDescription << expectedResults;
}
@@ -3201,7 +3201,7 @@ private Q_SLOTS:
channelDescription.mappingId = channelMapping->peerId();
channelDescription.type = static_cast<int>(QMetaType::QQuaternion);
channelDescription.name = QLatin1String("rotation");
- const QList<float> expectedResults = { 1.0f, 0.0f, 0.0f, 0.0f };
+ const QVector<float> expectedResults = { 1.0f, 0.0f, 0.0f, 0.0f };
QTest::newRow("rotation") << handler << channelDescription << expectedResults;
}
@@ -3217,7 +3217,7 @@ private Q_SLOTS:
channelDescription.mappingId = channelMapping->peerId();
channelDescription.type = static_cast<int>(QMetaType::QVector3D);
channelDescription.name = QLatin1String("scale");
- const QList<float> expectedResults = { 1.0f, 1.0f, 1.0f };
+ const QVector<float> expectedResults = { 1.0f, 1.0f, 1.0f };
QTest::newRow("scale") << handler << channelDescription << expectedResults;
}
@@ -3233,7 +3233,7 @@ private Q_SLOTS:
channelDescription.type = static_cast<int>(QMetaType::QVector3D);
channelDescription.jointIndex = 0;
channelDescription.jointTransformComponent = Scale;
- const QList<float> expectedResults = { 2.0f, 3.0f, 4.0f };
+ const QVector<float> expectedResults = { 2.0f, 3.0f, 4.0f };
QTest::newRow("joint 0 scale") << handler << channelDescription << expectedResults;
}
@@ -3248,7 +3248,7 @@ private Q_SLOTS:
channelDescription.type = static_cast<int>(QMetaType::QVector3D);
channelDescription.jointIndex = 0;
channelDescription.jointTransformComponent = Rotation;
- const QList<float> expectedResults = { 1.0f, 0.0f, 0.0f, 0.0f };
+ const QVector<float> expectedResults = { 1.0f, 0.0f, 0.0f, 0.0f };
QTest::newRow("joint 0 rotation") << handler << channelDescription << expectedResults;
}
@@ -3263,7 +3263,7 @@ private Q_SLOTS:
channelDescription.type = static_cast<int>(QMetaType::QVector3D);
channelDescription.jointIndex = 0;
channelDescription.jointTransformComponent = Translation;
- const QList<float> expectedResults = { 2.0f, 3.0f, 4.0f };
+ const QVector<float> expectedResults = { 2.0f, 3.0f, 4.0f };
QTest::newRow("joint 0 translation") << handler << channelDescription << expectedResults;
}
@@ -3278,7 +3278,7 @@ private Q_SLOTS:
channelDescription.type = static_cast<int>(QMetaType::QVector3D);
channelDescription.jointIndex = 1;
channelDescription.jointTransformComponent = Scale;
- const QList<float> expectedResults = { 20.0f, 30.0f, 40.0f };
+ const QVector<float> expectedResults = { 20.0f, 30.0f, 40.0f };
QTest::newRow("joint 1 scale") << handler << channelDescription << expectedResults;
}
@@ -3293,7 +3293,7 @@ private Q_SLOTS:
channelDescription.type = static_cast<int>(QMetaType::QVector3D);
channelDescription.jointIndex = 1;
channelDescription.jointTransformComponent = Rotation;
- const QList<float> expectedResults = { 1.0f, 0.0f, 0.0f, 0.0f };
+ const QVector<float> expectedResults = { 1.0f, 0.0f, 0.0f, 0.0f };
QTest::newRow("joint 1 rotation") << handler << channelDescription << expectedResults;
}
@@ -3308,7 +3308,7 @@ private Q_SLOTS:
channelDescription.type = static_cast<int>(QMetaType::QVector3D);
channelDescription.jointIndex = 1;
channelDescription.jointTransformComponent = Translation;
- const QList<float> expectedResults = { 4.0f, 5.0f, 6.0f };
+ const QVector<float> expectedResults = { 4.0f, 5.0f, 6.0f };
QTest::newRow("joint 1 translation") << handler << channelDescription << expectedResults;
}
}
@@ -3318,7 +3318,7 @@ private Q_SLOTS:
// GIVEN
QFETCH(Handler *, handler);
QFETCH(ChannelNameAndType, channelDescription);
- QFETCH(QList<float>, expectedResults);
+ QFETCH(QVector<float>, expectedResults);
// WHEN
auto actualResults = defaultValueForChannel(handler, channelDescription);
diff --git a/tests/auto/animation/bezierevaluator/tst_bezierevaluator.cpp b/tests/auto/animation/bezierevaluator/tst_bezierevaluator.cpp
index aa3679aef..a6460e4ef 100644
--- a/tests/auto/animation/bezierevaluator/tst_bezierevaluator.cpp
+++ b/tests/auto/animation/bezierevaluator/tst_bezierevaluator.cpp
@@ -79,7 +79,7 @@ private Q_SLOTS:
float c = 0.0f;
float d = 0.0f;
int rootCount = 1;
- QList<float> roots = { 0.0f };
+ QVector<float> roots = { 0.0f };
QTest::newRow("a=1, b=0, c=0, d=0") << a << b << c << d << rootCount << roots;
roots.clear();
diff --git a/tests/auto/animation/clipblendnode/tst_clipblendnode.cpp b/tests/auto/animation/clipblendnode/tst_clipblendnode.cpp
index 9a2d9765b..7cddbbb39 100644
--- a/tests/auto/animation/clipblendnode/tst_clipblendnode.cpp
+++ b/tests/auto/animation/clipblendnode/tst_clipblendnode.cpp
@@ -221,7 +221,7 @@ private Q_SLOTS:
blendNode->setClipResults(animatorId, clipResults);
}
- QList<int> indexes(animatorCount);
+ QVector<int> indexes(animatorCount);
std::iota(indexes.begin(), indexes.end(), 0);
QTest::newRow("multiple entries, ordered")
@@ -248,7 +248,7 @@ private Q_SLOTS:
}
// Shuffle the animatorIds to randomise the lookups
- QList<int> indexes(animatorCount);
+ QVector<int> indexes(animatorCount);
std::iota(indexes.begin(), indexes.end(), 0);
std::random_device rd;
std::mt19937 generator(rd());
@@ -263,7 +263,7 @@ private Q_SLOTS:
{
// GIVEN
QFETCH(TestClipBlendNode *, blendNode);
- QFETCH(QList<int>, indexes);
+ QFETCH(QVector<int>, indexes);
QFETCH(QList<Qt3DCore::QNodeId>, animatorIds);
QFETCH(QList<ClipResults>, expectedClipResults);
diff --git a/tests/auto/animation/clipblendvalue/tst_clipblendvalue.cpp b/tests/auto/animation/clipblendvalue/tst_clipblendvalue.cpp
index fce78a0e0..141da6d4c 100644
--- a/tests/auto/animation/clipblendvalue/tst_clipblendvalue.cpp
+++ b/tests/auto/animation/clipblendvalue/tst_clipblendvalue.cpp
@@ -211,7 +211,7 @@ private Q_SLOTS:
blendNode->setClipFormat(animatorId, clipFormat);
}
- QList<int> indexes(animatorCount);
+ QVector<int> indexes(animatorCount);
std::iota(indexes.begin(), indexes.end(), 0);
QTest::newRow("multiple entries, ordered")
@@ -238,7 +238,7 @@ private Q_SLOTS:
}
// Shuffle the animatorIds to randomise the lookups
- QList<int> indexes(animatorCount);
+ QVector<int> indexes(animatorCount);
std::iota(indexes.begin(), indexes.end(), 0);
std::random_device rd;
std::mt19937 generator(rd());
diff --git a/tests/auto/animation/findrunningclipanimatorsjob/tst_findrunningclipanimatorsjob.cpp b/tests/auto/animation/findrunningclipanimatorsjob/tst_findrunningclipanimatorsjob.cpp
index aea512f1c..7d8ef5723 100644
--- a/tests/auto/animation/findrunningclipanimatorsjob/tst_findrunningclipanimatorsjob.cpp
+++ b/tests/auto/animation/findrunningclipanimatorsjob/tst_findrunningclipanimatorsjob.cpp
@@ -46,9 +46,9 @@
using namespace Qt3DAnimation::Animation;
Q_DECLARE_METATYPE(Qt3DAnimation::Animation::Handler*)
-Q_DECLARE_METATYPE(QList<Qt3DAnimation::Animation::HClipAnimator>)
+Q_DECLARE_METATYPE(QVector<Qt3DAnimation::Animation::HClipAnimator>)
-using MappingDataResults = QHash<ClipAnimator *, QList<Qt3DAnimation::Animation::MappingData>>;
+using MappingDataResults = QHash<ClipAnimator *, QVector<Qt3DAnimation::Animation::MappingData>>;
Q_DECLARE_METATYPE(MappingDataResults)
class tst_FindRunningClipAnimatorsJob: public Qt3DCore::QBackendNodeTester
@@ -116,7 +116,7 @@ private Q_SLOTS:
void checkJob_data()
{
QTest::addColumn<Handler *>("handler");
- QTest::addColumn<QList<HClipAnimator>>("dirtyClipAnimators");
+ QTest::addColumn<QVector<HClipAnimator>>("dirtyClipAnimators");
QTest::addColumn<MappingDataResults>("expectedResults");
@@ -133,7 +133,7 @@ private Q_SLOTS:
const int loops = 1;
animator = createClipAnimator(handler, globalStartTimeNS, loops);
animator->setClipId(clip->peerId());
- const QList<HClipAnimator> dirtyClipAnimators
+ const QVector<HClipAnimator> dirtyClipAnimators
= { handler->clipAnimatorManager()->getOrAcquireHandle(animator->peerId()) };
auto channelMapping = createChannelMapping(handler,
@@ -153,7 +153,7 @@ private Q_SLOTS:
expectedMapping.propertyName = channelMapping->propertyName();
expectedMapping.type = channelMapping->type();
expectedMapping.channelIndices = locationIndices;
- expectedResults.insert(animator, QList<MappingData> { expectedMapping });
+ expectedResults.insert(animator, QVector<MappingData> { expectedMapping });
QTest::newRow("single mapping")
<< handler
@@ -174,7 +174,7 @@ private Q_SLOTS:
const int loops = 1;
animator = createClipAnimator(handler, globalStartTimeNS, loops);
animator->setClipId(clip->peerId());
- const QList<HClipAnimator> dirtyClipAnimators
+ const QVector<HClipAnimator> dirtyClipAnimators
= { handler->clipAnimatorManager()->getOrAcquireHandle(animator->peerId()) };
auto channelMapping = createChannelMapping(handler,
@@ -199,7 +199,7 @@ private Q_SLOTS:
{
// GIVEN
QFETCH(Handler *, handler);
- QFETCH(QList<HClipAnimator>, dirtyClipAnimators);
+ QFETCH(QVector<HClipAnimator>, dirtyClipAnimators);
QFETCH(MappingDataResults, expectedResults);
FindRunningClipAnimatorsJob job;
@@ -211,8 +211,8 @@ private Q_SLOTS:
// THEN - check the resulting MappingData on the animator matches the expected results
for (const auto &dirtyClipAnimator : dirtyClipAnimators) {
const auto animator = handler->clipAnimatorManager()->data(dirtyClipAnimator);
- const QList<MappingData> actualMappingData = animator->mappingData();
- const QList<MappingData> expectedMappingData = expectedResults[animator];
+ const QVector<MappingData> actualMappingData = animator->mappingData();
+ const QVector<MappingData> expectedMappingData = expectedResults[animator];
QCOMPARE(expectedMappingData.size(), actualMappingData.size());
for (int i = 0; i < actualMappingData.size(); ++i) {
diff --git a/tests/auto/animation/functionrangefinder/tst_functionrangefinder.cpp b/tests/auto/animation/functionrangefinder/tst_functionrangefinder.cpp
index 05e05ab98..7649eacca 100644
--- a/tests/auto/animation/functionrangefinder/tst_functionrangefinder.cpp
+++ b/tests/auto/animation/functionrangefinder/tst_functionrangefinder.cpp
@@ -56,7 +56,7 @@ private Q_SLOTS:
QTest::addColumn<int>("correlationThreshold");
QTest::addColumn<bool>("ascending");
- QList<float> data = { 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f };
+ QVector<float> data = { 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f };
int correlationThreshold = 1;
bool ascending = true;
QTest::newRow("10 entries, ascending") << data << correlationThreshold << ascending;
@@ -101,9 +101,9 @@ private Q_SLOTS:
QTest::addColumn<QList<float>>("needles");
QTest::addColumn<QList<int>>("lowerBounds");
- QList<float> data = { 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f };
- QList<float> needles = { 2.5f };
- QList<int> lowerBounds = { 1 };
+ QVector<float> data = { 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f };
+ QVector<float> needles = { 2.5f };
+ QVector<int> lowerBounds = { 1 };
QTest::newRow("10 entries, ascending") << data << needles << lowerBounds;
data.clear();
needles.clear();
diff --git a/tests/auto/animation/qchannelmapping/tst_qchannelmapping.cpp b/tests/auto/animation/qchannelmapping/tst_qchannelmapping.cpp
index dd40192b8..604b4032e 100644
--- a/tests/auto/animation/qchannelmapping/tst_qchannelmapping.cpp
+++ b/tests/auto/animation/qchannelmapping/tst_qchannelmapping.cpp
@@ -245,7 +245,7 @@ private Q_SLOTS:
QVariantList list = QVariantList() << QVariant(1.0f) << QVariant(1.0) << QVariant(1.0f) << QVariant(1.0f) << QVariant(1.0f);
QTest::newRow("variantlist") << QByteArrayLiteral("listProperty") << QVariant::fromValue(list) << static_cast<int>(QMetaType::QVariantList) << 5;
- QList<float> vec(8);
+ QVector<float> vec(8);
QTest::newRow("vector") << QByteArrayLiteral("vecProperty") << QVariant::fromValue(vec) << qMetaTypeId<decltype(vec)>() << 8;
}
diff --git a/tests/auto/animation/qmorphinganimation/tst_qmorphinganimation.cpp b/tests/auto/animation/qmorphinganimation/tst_qmorphinganimation.cpp
index faf6c7416..3020113b1 100644
--- a/tests/auto/animation/qmorphinganimation/tst_qmorphinganimation.cpp
+++ b/tests/auto/animation/qmorphinganimation/tst_qmorphinganimation.cpp
@@ -186,14 +186,14 @@ private Q_SLOTS:
morphingAnimation.addMorphTarget(mt2);
morphingAnimation.addMorphTarget(mt3);
- const QList<float> positions = { 0.0f, 1.0f, 2.0f, 3.0f, 4.0f };
+ const QVector<float> positions = { 0.0f, 1.0f, 2.0f, 3.0f, 4.0f };
morphingAnimation.setTargetPositions(positions);
- morphingAnimation.setWeights(0, QList<float> { 1.0f, 0.0f, 0.0f });
- morphingAnimation.setWeights(1, QList<float> { 0.0f, 0.0f, 0.0f });
- morphingAnimation.setWeights(2, QList<float> { 0.0f, 1.0f, 0.0f });
- morphingAnimation.setWeights(3, QList<float> { 0.0f, 0.0f, 0.0f });
- morphingAnimation.setWeights(4, QList<float> { 0.0f, 0.0f, 1.0f });
+ morphingAnimation.setWeights(0, QVector<float> { 1.0f, 0.0f, 0.0f });
+ morphingAnimation.setWeights(1, QVector<float> { 0.0f, 0.0f, 0.0f });
+ morphingAnimation.setWeights(2, QVector<float> { 0.0f, 1.0f, 0.0f });
+ morphingAnimation.setWeights(3, QVector<float> { 0.0f, 0.0f, 0.0f });
+ morphingAnimation.setWeights(4, QVector<float> { 0.0f, 0.0f, 1.0f });
morphingAnimation.setMethod(Qt3DAnimation::QMorphingAnimation::Relative);
{
diff --git a/tests/auto/animation/skeleton/tst_skeleton.cpp b/tests/auto/animation/skeleton/tst_skeleton.cpp
index a17bfcab5..24883e343 100644
--- a/tests/auto/animation/skeleton/tst_skeleton.cpp
+++ b/tests/auto/animation/skeleton/tst_skeleton.cpp
@@ -75,7 +75,7 @@ private Q_SLOTS:
{
// GIVEN
Skeleton backendSkeleton;
- const QList<QString> jointNames = { QLatin1String("rootJoint"),
+ const QVector<QString> jointNames = { QLatin1String("rootJoint"),
QLatin1String("child1Joint"),
QLatin1String("child2Joint") };
@@ -103,10 +103,10 @@ private Q_SLOTS:
QCOMPARE(backendSkeleton.jointLocalPoses().size(), 0);
// GIVEN
- const QList<QString> names = { QLatin1String("root"),
- QLatin1String("child1"),
- QLatin1String("child2") };
- const QList<Sqt> localPoses = { Sqt(), Sqt(), Sqt() };
+ const QVector<QString> names = { QLatin1String("root"),
+ QLatin1String("child1"),
+ QLatin1String("child2") };
+ const QVector<Sqt> localPoses = { Sqt(), Sqt(), Sqt() };
// WHEN
backendSkeleton.setJointNames(names);
diff --git a/tests/auto/core/nodes/tst_nodes.cpp b/tests/auto/core/nodes/tst_nodes.cpp
index fcc38797e..1edaf42ce 100644
--- a/tests/auto/core/nodes/tst_nodes.cpp
+++ b/tests/auto/core/nodes/tst_nodes.cpp
@@ -1117,10 +1117,10 @@ void tst_Nodes::removingMultipleChildNodesFromNode()
QVERIFY(Qt3DCore::QNodePrivate::get(root.data())->scene() != nullptr);
// WHEN
- Qt3DCore::QNodeIdVector childIds(10);
+ Qt3DCore::QNodeIdVector childIds;
for (int i = 0; i < 10; i++) {
auto child = new MyQNode(root.data());
- childIds[i] = child->id();
+ childIds.push_back(child->id());
}
QCoreApplication::processEvents();
diff --git a/tests/auto/render/opengl/qgraphicsutils/tst_qgraphicsutils.cpp b/tests/auto/render/opengl/qgraphicsutils/tst_qgraphicsutils.cpp
index 9f452cd24..aefbeffbe 100644
--- a/tests/auto/render/opengl/qgraphicsutils/tst_qgraphicsutils.cpp
+++ b/tests/auto/render/opengl/qgraphicsutils/tst_qgraphicsutils.cpp
@@ -168,7 +168,7 @@ void tst_QGraphicsUtils::fillScalarWithOffsets()
intUniform.m_matrixStride = 0;
intUniform.m_offset = 48;
- QList<GLfloat> data(16);
+ QVector<GLfloat> data(16);
void *innerData = data.data();
Qt3DRender::Render::OpenGL::QGraphicsUtils::fillDataArray(innerData,
diff --git a/tests/auto/render/opengl/renderqueue/tst_renderqueue.cpp b/tests/auto/render/opengl/renderqueue/tst_renderqueue.cpp
index b06025b50..ca176f7c2 100644
--- a/tests/auto/render/opengl/renderqueue/tst_renderqueue.cpp
+++ b/tests/auto/render/opengl/renderqueue/tst_renderqueue.cpp
@@ -101,7 +101,7 @@ void tst_RenderQueue::checkOrder()
// GIVEN
Qt3DRender::Render::RenderQueue<Qt3DRender::Render::OpenGL::RenderView> renderQueue;
renderQueue.setTargetRenderViewCount(7);
- QList<Qt3DRender::Render::OpenGL::RenderView *> renderViews(7);
+ QVector<Qt3DRender::Render::OpenGL::RenderView *> renderViews(7);
// WHEN
for (int i = 0; i < 7; ++i) {
@@ -122,7 +122,7 @@ void tst_RenderQueue::checkTimeToSubmit()
// GIVEN
Qt3DRender::Render::RenderQueue<Qt3DRender::Render::OpenGL::RenderView> renderQueue;
renderQueue.setTargetRenderViewCount(7);
- QList<Qt3DRender::Render::OpenGL::RenderView *> renderViews(7);
+ QVector<Qt3DRender::Render::OpenGL::RenderView *> renderViews(7);
// WHEN
for (int i = 0; i < 7; i++) {
@@ -222,7 +222,7 @@ void tst_RenderQueue::resetQueue()
QVERIFY(renderQueue.currentRenderViewCount() == 0);
// WHEN
- QList<Qt3DRender::Render::OpenGL::RenderView *> renderViews(5);
+ QVector<Qt3DRender::Render::OpenGL::RenderView *> renderViews(5);
for (int i = 0; i < 5; ++i) {
renderQueue.queueRenderView(renderViews.at(i), i);
}
diff --git a/tests/auto/render/uniform/tst_uniform.cpp b/tests/auto/render/uniform/tst_uniform.cpp
index 3a3ee5667..8e7a50579 100644
--- a/tests/auto/render/uniform/tst_uniform.cpp
+++ b/tests/auto/render/uniform/tst_uniform.cpp
@@ -133,7 +133,7 @@ private Q_SLOTS:
QMatrix4x4 m4;
m4.translate(1.0f, 2.0f, 3.0f);
- const QList<QMatrix4x4> matrices = { m1, m2, m3, m4 };
+ const QVector<QMatrix4x4> matrices = { m1, m2, m3, m4 };
UniformValue v(matrices);
// THEN
@@ -389,11 +389,11 @@ private Q_SLOTS:
QMatrix4x4 m4;
m4.translate(1.0f, 2.0f, 3.0f);
- const QList<QMatrix4x4> matrices1 = { m1, m2, m3, m4 };
+ const QVector<QMatrix4x4> matrices1 = { m1, m2, m3, m4 };
UniformValue v(matrices1);
// WHEN
- const QList<QMatrix4x4> matrices2 = { m4, m3, m2, m1, m4 };
+ const QVector<QMatrix4x4> matrices2 = { m4, m3, m2, m1, m4 };
v.setData(matrices2);
// THEN
@@ -405,7 +405,7 @@ private Q_SLOTS:
// GIVEN
const int positionCount = 10;
- QList<QVector3D> positions(positionCount);
+ QVector<QVector3D> positions(positionCount);
for (int i = 0; i < positionCount; ++i) {
const QVector3D p(float(i), 10.0f * i, 100.0f * i);
positions[i] = p;
diff --git a/tests/benchmarks/core/qresourcesmanager/arraypolicy/tst_bench_arraypolicy.cpp b/tests/benchmarks/core/qresourcesmanager/arraypolicy/tst_bench_arraypolicy.cpp
index d0b105bb9..5bac867d7 100644
--- a/tests/benchmarks/core/qresourcesmanager/arraypolicy/tst_bench_arraypolicy.cpp
+++ b/tests/benchmarks/core/qresourcesmanager/arraypolicy/tst_bench_arraypolicy.cpp
@@ -69,8 +69,8 @@ void benchmarkReleaseResources()
Qt3DCore::ArrayAllocatingPolicy<T> allocator;
const int max = (1 << 16) - 1;
- QList<Qt3DCore::QHandle<T>> resources(max);
- for (int i = 0; i < max; i++) {
+ std::vector<Qt3DCore::QHandle<T>> resources(max);
+ for (size_t i = 0; i < max; i++) {
resources[i] = allocator.allocateResource();
}
diff --git a/tests/benchmarks/core/qresourcesmanager/qresourcesmanager/tst_bench_qresourcesmanager.cpp b/tests/benchmarks/core/qresourcesmanager/qresourcesmanager/tst_bench_qresourcesmanager.cpp
index 6d41bdce0..b82c90ba5 100644
--- a/tests/benchmarks/core/qresourcesmanager/qresourcesmanager/tst_bench_qresourcesmanager.cpp
+++ b/tests/benchmarks/core/qresourcesmanager/qresourcesmanager/tst_bench_qresourcesmanager.cpp
@@ -85,14 +85,14 @@ template<typename Resource>
void benchmarkAccessResources()
{
Qt3DCore::QResourceManager<Resource, int> manager;
- const int max = (1 << 16) - 1;
- QList<Qt3DCore::QHandle<Resource> > handles(max);
- for (int i = 0; i < max; i++)
+ const size_t max = (1 << 16) - 1;
+ std::vector<Qt3DCore::QHandle<Resource> > handles(max);
+ for (size_t i = 0; i < max; i++)
handles[i] = manager.acquire();
volatile Resource *c;
QBENCHMARK {
- for (int i = 0; i < max; i++)
+ for (size_t i = 0; i < max; i++)
c = manager.data(handles[i]);
}
Q_UNUSED(c);
@@ -101,9 +101,9 @@ void benchmarkAccessResources()
template<typename Resource>
void benchmarkRandomAccessResource() {
Qt3DCore::QResourceManager<Resource, int> manager;
- const int max = (1 << 16) - 1;
- QList<Qt3DCore::QHandle<Resource> > handles(max);
- for (int i = 0; i < max; i++)
+ const size_t max = (1 << 16) - 1;
+ std::vector<Qt3DCore::QHandle<Resource> > handles(max);
+ for (size_t i = 0; i < max; i++)
handles[i] = manager.acquire();
std::random_device rd;
@@ -112,7 +112,7 @@ void benchmarkRandomAccessResource() {
volatile Resource *c;
QBENCHMARK {
- for (int i = 0; i < max; i++)
+ for (size_t i = 0; i < max; i++)
c = manager.data(handles[i]);
}
Q_UNUSED(c);
@@ -139,7 +139,7 @@ void benchmarkRandomLookupResources()
{
Qt3DCore::QResourceManager<Resource, int> manager;
const int max = (1 << 16) - 1;
- QList<int> resourcesIndices(max);
+ QVector<int> resourcesIndices(max);
for (int i = 0; i < max; i++) {
manager.getOrCreateResource(i);
resourcesIndices[i] = i;
@@ -161,11 +161,11 @@ template<typename Resource>
void benchmarkReleaseResources()
{
Qt3DCore::QResourceManager<Resource, int> manager;
- const int max = (1 << 16) - 1;
- QList<Qt3DCore::QHandle<Resource> > handles(max);
- for (int i = 0; i < max; i++)
+ const size_t max = (1 << 16) - 1;
+ std::vector<Qt3DCore::QHandle<Resource> > handles(max);
+ for (size_t i = 0; i < max; i++)
handles[i] = manager.acquire();
- for (int i = 0; i < max; i++)
+ for (size_t i = 0; i < max; i++)
manager.release(handles.at(i));
handles.clear();
diff --git a/tests/benchmarks/render/opengl/shaderparameterpack/tst_bench_shaderparameterpack.cpp b/tests/benchmarks/render/opengl/shaderparameterpack/tst_bench_shaderparameterpack.cpp
index 16ecfc99e..5b014983a 100644
--- a/tests/benchmarks/render/opengl/shaderparameterpack/tst_bench_shaderparameterpack.cpp
+++ b/tests/benchmarks/render/opengl/shaderparameterpack/tst_bench_shaderparameterpack.cpp
@@ -47,10 +47,10 @@ private Q_SLOTS:
// GIVEN
PackUniformHash pack;
- QList<int> randKeys(64);
+ std::vector<int> randKeys(64);
QRandomGenerator gen;
- for (int i = 0; i < 64; ++i)
+ for (size_t i = 0; i < 64; ++i)
randKeys[i] = gen.generate();
QBENCHMARK {
diff --git a/tests/manual/custom-mesh-cpp-indirect/main.cpp b/tests/manual/custom-mesh-cpp-indirect/main.cpp
index 87ca2b2dc..dcdbbfcd9 100644
--- a/tests/manual/custom-mesh-cpp-indirect/main.cpp
+++ b/tests/manual/custom-mesh-cpp-indirect/main.cpp
@@ -303,7 +303,7 @@ int main(int argc, char* argv[])
Qt3DCore::QBuffer *indirectDrawDataBuffer = new Qt3DCore::QBuffer(customGeometry);
- QList<QVector3D> orderedPositionVertices;
+ QVector<QVector3D> orderedPositionVertices;
// 12 vertices with position, normal, color
orderedPositionVertices.reserve(12 * (1 + 1 + 1));