summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@qt.io>2022-11-11 15:53:00 +0100
committerMarc Mutz <marc.mutz@qt.io>2022-11-15 14:24:47 +0100
commit49f57b3ad7335881213d3eb66f40035a01c4610d (patch)
tree0206053c4bdc29a30ce02bc1677ce8956accbb76 /src
parent95cb20e3811e87cf4bb316f65e0a5843ddadbbdc (diff)
Port from container::count() and length() to size() - V5
This is a the same semantic patch (qt-port-to-std-compatible-api V5 with config Scope: 'Container') as in dev. I've re-ran it in 6.4 to avoid cherry-pick conflicts. Change-Id: Ie2bc4384f96350d35e17699b758cc10cbfd6d175 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/bodymovin/bmbase.cpp4
-rw-r--r--src/bodymovin/bmfreeformshape.cpp14
-rw-r--r--src/bodymovin/bmimage.cpp2
-rw-r--r--src/bodymovin/bmimagelayer.cpp2
-rw-r--r--src/bodymovin/bmproperty_p.h10
-rw-r--r--src/bodymovin/bmshapelayer.cpp2
-rw-r--r--src/bodymovin/lottierenderer.cpp2
-rw-r--r--src/imports/rasterrenderer/batchrenderer.cpp2
8 files changed, 19 insertions, 19 deletions
diff --git a/src/bodymovin/bmbase.cpp b/src/bodymovin/bmbase.cpp
index b0e0a71..af7f475 100644
--- a/src/bodymovin/bmbase.cpp
+++ b/src/bodymovin/bmbase.cpp
@@ -191,11 +191,11 @@ const QJsonObject BMBase::resolveExpression(const QJsonObject &definition)
QJsonObject retVal = definition;
if (BMBase *source = m_topRoot->findChild(effect)) {
- if (source->children().length())
+ if (source->children().size())
retVal = source->children().at(0)->definition().value(QLatin1String("v")).toObject();
else
retVal = source->definition().value(QLatin1String("v")).toObject();
- if (source->children().length() > 1)
+ if (source->children().size() > 1)
qCWarning(lcLottieQtBodymovinParser) << "Effect source points"
"to a group that has"
"many children. The"
diff --git a/src/bodymovin/bmfreeformshape.cpp b/src/bodymovin/bmfreeformshape.cpp
index fac260e..0cfd83b 100644
--- a/src/bodymovin/bmfreeformshape.cpp
+++ b/src/bodymovin/bmfreeformshape.cpp
@@ -49,13 +49,13 @@ void BMFreeFormShape::construct(const QJsonObject &definition)
void BMFreeFormShape::updateProperties(int frame)
{
- if (m_vertexMap.count()) {
+ if (m_vertexMap.size()) {
QJsonObject keyframe = m_vertexMap.value(frame);
// If this frame is a keyframe, so values must be updated
if (!keyframe.isEmpty())
buildShape(keyframe.value(QLatin1String("s")).toArray().at(0).toObject());
} else {
- for (int i =0; i < m_vertexList.count(); i++) {
+ for (int i =0; i < m_vertexList.size(); i++) {
VertexInfo vi = m_vertexList.at(i);
vi.pos.update(frame);
vi.ci.update(frame);
@@ -86,7 +86,7 @@ void BMFreeFormShape::parseShapeKeyframes(QJsonObject &keyframes)
} else
parseEasedVertices(keyframe, keyframe.value(QLatin1String("t")).toVariant().toInt());
}
- if (m_vertexInfos.count())
+ if (m_vertexInfos.size())
finalizeVertices();
}
@@ -165,7 +165,7 @@ void BMFreeFormShape::buildShape(int frame)
needToClose = (*it);
// If there are less than two vertices, cannot make a bezier curve
- if (m_vertexList.count() < 2)
+ if (m_vertexList.size() < 2)
return;
QPointF s(m_vertexList.at(0).pos.value());
@@ -174,7 +174,7 @@ void BMFreeFormShape::buildShape(int frame)
m_path.moveTo(s);
int i = 0;
- while (i < m_vertexList.count() - 1) {
+ while (i < m_vertexList.size() - 1) {
QPointF v = m_vertexList.at(i + 1).pos.value();
QPointF c1 = m_vertexList.at(i).co.value();
QPointF c2 = m_vertexList.at(i + 1).ci.value();
@@ -248,7 +248,7 @@ void BMFreeFormShape::parseEasedVertices(const QJsonObject &keyframe, int startF
} else {
// Last keyframe
- int vertexCount = m_vertexInfos.count();
+ int vertexCount = m_vertexInfos.size();
for (int i = 0; i < vertexCount; i++) {
VertexBuildInfo *buildInfo = m_vertexInfos.value(i, nullptr);
if (!buildInfo) {
@@ -275,7 +275,7 @@ void BMFreeFormShape::parseEasedVertices(const QJsonObject &keyframe, int startF
void BMFreeFormShape::finalizeVertices()
{
- for (int i = 0; i < m_vertexInfos.count(); i++) {
+ for (int i = 0; i < m_vertexInfos.size(); i++) {
QJsonObject posObj;
posObj.insert(QLatin1String("a"), 1);
posObj.insert(QLatin1String("k"), m_vertexInfos.value(i)->posKeyframes);
diff --git a/src/bodymovin/bmimage.cpp b/src/bodymovin/bmimage.cpp
index 366cad0..3b0f19c 100644
--- a/src/bodymovin/bmimage.cpp
+++ b/src/bodymovin/bmimage.cpp
@@ -43,7 +43,7 @@ void BMImage::construct(const QJsonObject &definition)
if (assetString.startsWith(QLatin1String("data:image"))) {
QStringList assetsDataStringList = assetString.split(QLatin1String(","));
- if (assetsDataStringList.length() > 1) {
+ if (assetsDataStringList.size() > 1) {
QByteArray assetData = QByteArray::fromBase64(assetsDataStringList[1].toLatin1());
m_image.loadFromData(assetData);
}
diff --git a/src/bodymovin/bmimagelayer.cpp b/src/bodymovin/bmimagelayer.cpp
index 912284b..8090132 100644
--- a/src/bodymovin/bmimagelayer.cpp
+++ b/src/bodymovin/bmimagelayer.cpp
@@ -58,7 +58,7 @@ BMImageLayer::BMImageLayer(const QJsonObject &definition)
appendChild(shape);
}
- if (m_maskProperties.length())
+ if (m_maskProperties.size())
qCWarning(lcLottieQtBodymovinParser)
<< "BM Image Layer: mask properties found, but not supported"
<< m_maskProperties;
diff --git a/src/bodymovin/bmproperty_p.h b/src/bodymovin/bmproperty_p.h
index f3615b0..89acd77 100644
--- a/src/bodymovin/bmproperty_p.h
+++ b/src/bodymovin/bmproperty_p.h
@@ -105,13 +105,13 @@ public:
protected:
void addEasing(EasingSegment<T>& easing)
{
- if (m_easingCurves.length()) {
+ if (m_easingCurves.size()) {
EasingSegment<T> prevEase = m_easingCurves.last();
// The end value has to be hand picked to the
// previous easing segment, as the json data does
// not contain end values for segments
prevEase.endFrame = easing.startFrame - 1;
- m_easingCurves.replace(m_easingCurves.length() - 1, prevEase);
+ m_easingCurves.replace(m_easingCurves.size() - 1, prevEase);
}
m_easingCurves.push_back(easing);
}
@@ -122,7 +122,7 @@ protected:
const EasingSegment<T> *easing = m_currentEasing;
if (!easing || easing->startFrame < frame ||
easing->endFrame > frame) {
- for (int i=0; i < m_easingCurves.length(); i++) {
+ for (int i=0; i < m_easingCurves.size(); i++) {
if (m_easingCurves.at(i).startFrame <= frame &&
m_easingCurves.at(i).endFrame >= frame) {
m_currentEasing = &m_easingCurves.at(i);
@@ -155,7 +155,7 @@ protected:
this->m_endFrame = startTime;
easing.startFrame = startTime;
easing.endFrame = startTime;
- if (m_easingCurves.length()) {
+ if (m_easingCurves.size()) {
easing.startValue = m_easingCurves.last().endValue;
easing.endValue = m_easingCurves.last().endValue;
}
@@ -255,7 +255,7 @@ protected:
this->m_endFrame = startTime;
easingCurve.startFrame = startTime;
easingCurve.endFrame = startTime;
- if (this->m_easingCurves.length()) {
+ if (this->m_easingCurves.size()) {
easingCurve.startValue = this->m_easingCurves.last().endValue;
easingCurve.endValue = this->m_easingCurves.last().endValue;
}
diff --git a/src/bodymovin/bmshapelayer.cpp b/src/bodymovin/bmshapelayer.cpp
index a113cd7..71d7e42 100644
--- a/src/bodymovin/bmshapelayer.cpp
+++ b/src/bodymovin/bmshapelayer.cpp
@@ -55,7 +55,7 @@ BMShapeLayer::BMShapeLayer(const QJsonObject &definition)
appendChild(shape);
}
- if (m_maskProperties.length())
+ if (m_maskProperties.size())
qCWarning(lcLottieQtBodymovinParser)
<< "BM Shape Layer: mask properties found, but not supported"
<< m_maskProperties;
diff --git a/src/bodymovin/lottierenderer.cpp b/src/bodymovin/lottierenderer.cpp
index e1b943c..1fe486b 100644
--- a/src/bodymovin/lottierenderer.cpp
+++ b/src/bodymovin/lottierenderer.cpp
@@ -22,7 +22,7 @@ void LottieRenderer::saveTrimmingState()
void LottieRenderer::restoreTrimmingState()
{
- if (m_trimStateStack.count())
+ if (m_trimStateStack.size())
m_trimmingState = m_trimStateStack.pop();
}
diff --git a/src/imports/rasterrenderer/batchrenderer.cpp b/src/imports/rasterrenderer/batchrenderer.cpp
index 0055b5c..5e09e60 100644
--- a/src/imports/rasterrenderer/batchrenderer.cpp
+++ b/src/imports/rasterrenderer/batchrenderer.cpp
@@ -152,7 +152,7 @@ BMBase *BatchRenderer::getFrame(LottieAnimation *animator, int frameNumber)
void BatchRenderer::prerender(Entry *animEntry)
{
- while (animEntry->frameCache.count() < m_cacheSize) {
+ while (animEntry->frameCache.size() < m_cacheSize) {
BMBase *&bmTree = animEntry->frameCache[animEntry->currentFrame];
if (bmTree == nullptr) {
bmTree = new BMBase(*animEntry->bmTreeBlueprint);