summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKonrad Kujawa <konrad.kujawa@qt.io>2022-08-25 13:18:39 +0200
committerKonrad Kujawa <konrad.kujawa@qt.io>2023-02-01 17:06:35 +0100
commit30344aaa49ec495912fc6ce1fd9aa9bbc8585521 (patch)
tree865370ccf3282766fe068dcd63a8238ed1b9a2ac
parent4c445ef0bae8b36ec4a742552f0ebd81a1a90723 (diff)
Migration from int to qsizetype of QAnimationGroup
QAnimationGroup, QAnimationGroupPrivate uses now qsizetype instead of the int. Task-number: QTBUG-103530 Pick-to: 6.5 Change-Id: I96053a609bc4fad32adce5616eef1af9a86f4e27 Reviewed-by: Marc Mutz <marc.mutz@qt.io>
-rw-r--r--src/corelib/animation/qanimationgroup.cpp6
-rw-r--r--src/corelib/animation/qanimationgroup_p.h4
-rw-r--r--src/corelib/animation/qparallelanimationgroup.cpp2
-rw-r--r--src/corelib/animation/qparallelanimationgroup_p.h2
-rw-r--r--src/corelib/animation/qsequentialanimationgroup.cpp8
-rw-r--r--src/corelib/animation/qsequentialanimationgroup_p.h4
6 files changed, 13 insertions, 13 deletions
diff --git a/src/corelib/animation/qanimationgroup.cpp b/src/corelib/animation/qanimationgroup.cpp
index e8ffd99dcb..d2572a7462 100644
--- a/src/corelib/animation/qanimationgroup.cpp
+++ b/src/corelib/animation/qanimationgroup.cpp
@@ -186,7 +186,7 @@ void QAnimationGroup::removeAnimation(QAbstractAnimation *animation)
qWarning("QAnimationGroup::remove: cannot remove null animation");
return;
}
- int index = d->animations.indexOf(animation);
+ qsizetype index = d->animations.indexOf(animation);
if (index == -1) {
qWarning("QAnimationGroup::remove: animation is not part of this group");
return;
@@ -261,7 +261,7 @@ void QAnimationGroupPrivate::clear(bool onDestruction)
const QList<QAbstractAnimation *> animationsCopy = animations; // taking a copy
animations.clear();
// Clearing backwards so the indices doesn't change while we remove animations.
- for (int i = animationsCopy.size() - 1; i >= 0; --i) {
+ for (qsizetype i = animationsCopy.size() - 1; i >= 0; --i) {
QAbstractAnimation *animation = animationsCopy.at(i);
animation->setParent(nullptr);
QAbstractAnimationPrivate::get(animation)->group = nullptr;
@@ -275,7 +275,7 @@ void QAnimationGroupPrivate::clear(bool onDestruction)
}
}
-void QAnimationGroupPrivate::animationRemoved(int index, QAbstractAnimation *)
+void QAnimationGroupPrivate::animationRemoved(qsizetype index, QAbstractAnimation *)
{
Q_Q(QAnimationGroup);
Q_UNUSED(index);
diff --git a/src/corelib/animation/qanimationgroup_p.h b/src/corelib/animation/qanimationgroup_p.h
index 8885989e4e..334f780968 100644
--- a/src/corelib/animation/qanimationgroup_p.h
+++ b/src/corelib/animation/qanimationgroup_p.h
@@ -34,8 +34,8 @@ public:
isGroup = true;
}
- virtual void animationInsertedAt(int) { }
- virtual void animationRemoved(int, QAbstractAnimation *);
+ virtual void animationInsertedAt(qsizetype) { }
+ virtual void animationRemoved(qsizetype, QAbstractAnimation *);
void clear(bool onDestruction);
diff --git a/src/corelib/animation/qparallelanimationgroup.cpp b/src/corelib/animation/qparallelanimationgroup.cpp
index 58d49bff5d..cea22bcacb 100644
--- a/src/corelib/animation/qparallelanimationgroup.cpp
+++ b/src/corelib/animation/qparallelanimationgroup.cpp
@@ -255,7 +255,7 @@ bool QParallelAnimationGroupPrivate::isUncontrolledAnimationFinished(QAbstractAn
return uncontrolledFinishTime.value(anim, -1) >= 0;
}
-void QParallelAnimationGroupPrivate::animationRemoved(int index, QAbstractAnimation *anim)
+void QParallelAnimationGroupPrivate::animationRemoved(qsizetype index, QAbstractAnimation *anim)
{
QAnimationGroupPrivate::animationRemoved(index, anim);
disconnectUncontrolledAnimation(anim);
diff --git a/src/corelib/animation/qparallelanimationgroup_p.h b/src/corelib/animation/qparallelanimationgroup_p.h
index 773c768141..62c53d3609 100644
--- a/src/corelib/animation/qparallelanimationgroup_p.h
+++ b/src/corelib/animation/qparallelanimationgroup_p.h
@@ -42,7 +42,7 @@ public:
void connectUncontrolledAnimations();
void disconnectUncontrolledAnimations();
- void animationRemoved(int index, QAbstractAnimation *) override;
+ void animationRemoved(qsizetype index, QAbstractAnimation *) override;
// private slot
void _q_uncontrolledAnimationFinished();
diff --git a/src/corelib/animation/qsequentialanimationgroup.cpp b/src/corelib/animation/qsequentialanimationgroup.cpp
index 8e99d9cee0..260481dbef 100644
--- a/src/corelib/animation/qsequentialanimationgroup.cpp
+++ b/src/corelib/animation/qsequentialanimationgroup.cpp
@@ -472,7 +472,7 @@ void QSequentialAnimationGroupPrivate::_q_uncontrolledAnimationFinished()
the group at index \a index.
Note: We only support insertion after the current animation
*/
-void QSequentialAnimationGroupPrivate::animationInsertedAt(int index)
+void QSequentialAnimationGroupPrivate::animationInsertedAt(qsizetype index)
{
if (currentAnimation == nullptr) {
setCurrentAnimation(0); // initialize the current animation
@@ -500,7 +500,7 @@ void QSequentialAnimationGroupPrivate::animationInsertedAt(int index)
the group at index \a index. The animation is no more listed when this
method is called.
*/
-void QSequentialAnimationGroupPrivate::animationRemoved(int index, QAbstractAnimation *anim)
+void QSequentialAnimationGroupPrivate::animationRemoved(qsizetype index, QAbstractAnimation *anim)
{
Q_Q(QSequentialAnimationGroup);
QAnimationGroupPrivate::animationRemoved(index, anim);
@@ -511,7 +511,7 @@ void QSequentialAnimationGroupPrivate::animationRemoved(int index, QAbstractAnim
if (actualDuration.size() > index)
actualDuration.removeAt(index);
- const int currentIndex = animations.indexOf(currentAnimation);
+ const qsizetype currentIndex = animations.indexOf(currentAnimation);
if (currentIndex == -1) {
//we're removing the current animation
@@ -529,7 +529,7 @@ void QSequentialAnimationGroupPrivate::animationRemoved(int index, QAbstractAnim
// duration of the previous animations up to the current animation
currentTime = 0;
- for (int i = 0; i < currentAnimationIndex; ++i) {
+ for (qsizetype i = 0; i < currentAnimationIndex; ++i) {
const int current = animationActualTotalDuration(i);
currentTime += current;
}
diff --git a/src/corelib/animation/qsequentialanimationgroup_p.h b/src/corelib/animation/qsequentialanimationgroup_p.h
index fc791e0c77..cbdf204d0a 100644
--- a/src/corelib/animation/qsequentialanimationgroup_p.h
+++ b/src/corelib/animation/qsequentialanimationgroup_p.h
@@ -44,8 +44,8 @@ public:
void setCurrentAnimation(int index, bool intermediate = false);
void activateCurrentAnimation(bool intermediate = false);
- void animationInsertedAt(int index) override;
- void animationRemoved(int index, QAbstractAnimation *anim) override;
+ void animationInsertedAt(qsizetype index) override;
+ void animationRemoved(qsizetype index, QAbstractAnimation *anim) override;
bool atEnd() const;