diff options
Diffstat (limited to 'src/qml/animations')
-rw-r--r-- | src/qml/animations/qabstractanimationjob.cpp | 8 | ||||
-rw-r--r-- | src/qml/animations/qanimationgroupjob.cpp | 18 | ||||
-rw-r--r-- | src/qml/animations/qanimationgroupjob_p.h | 4 | ||||
-rw-r--r-- | src/qml/animations/qcontinuinganimationgroupjob.cpp | 1 | ||||
-rw-r--r-- | src/qml/animations/qparallelanimationgroupjob_p.h | 4 | ||||
-rw-r--r-- | src/qml/animations/qpauseanimationjob.cpp | 3 | ||||
-rw-r--r-- | src/qml/animations/qsequentialanimationgroupjob.cpp | 10 | ||||
-rw-r--r-- | src/qml/animations/qsequentialanimationgroupjob_p.h | 12 |
8 files changed, 29 insertions, 31 deletions
diff --git a/src/qml/animations/qabstractanimationjob.cpp b/src/qml/animations/qabstractanimationjob.cpp index b726d2fc43..3f33e7e81b 100644 --- a/src/qml/animations/qabstractanimationjob.cpp +++ b/src/qml/animations/qabstractanimationjob.cpp @@ -258,7 +258,7 @@ int QQmlAnimationTimer::closestPauseAnimationTimeToFinish() QAbstractAnimationJob::QAbstractAnimationJob() : m_loopCount(1) - , m_group(0) + , m_group(nullptr) , m_direction(QAbstractAnimationJob::Forward) , m_state(QAbstractAnimationJob::Stopped) , m_totalCurrentTime(0) @@ -266,9 +266,9 @@ QAbstractAnimationJob::QAbstractAnimationJob() , m_currentLoop(0) , m_uncontrolledFinishTime(-1) , m_currentLoopStartTime(0) - , m_nextSibling(0) - , m_previousSibling(0) - , m_wasDeleted(0) + , m_nextSibling(nullptr) + , m_previousSibling(nullptr) + , m_wasDeleted(nullptr) , m_hasRegisteredTimer(false) , m_isPause(false) , m_isGroup(false) diff --git a/src/qml/animations/qanimationgroupjob.cpp b/src/qml/animations/qanimationgroupjob.cpp index ea6d87952a..344791fd83 100644 --- a/src/qml/animations/qanimationgroupjob.cpp +++ b/src/qml/animations/qanimationgroupjob.cpp @@ -42,7 +42,7 @@ QT_BEGIN_NAMESPACE QAnimationGroupJob::QAnimationGroupJob() - : QAbstractAnimationJob(), m_firstChild(0), m_lastChild(0) + : QAbstractAnimationJob(), m_firstChild(nullptr), m_lastChild(nullptr) { m_isGroup = true; } @@ -111,25 +111,25 @@ void QAnimationGroupJob::removeAnimation(QAbstractAnimationJob *animation) else m_lastChild = prev; - animation->m_previousSibling = 0; - animation->m_nextSibling = 0; + animation->m_previousSibling = nullptr; + animation->m_nextSibling = nullptr; - animation->m_group = 0; + animation->m_group = nullptr; animationRemoved(animation, prev, next); } void QAnimationGroupJob::clear() { QAbstractAnimationJob *child = firstChild(); - QAbstractAnimationJob *nextSibling = 0; - while (child != 0) { - child->m_group = 0; + QAbstractAnimationJob *nextSibling = nullptr; + while (child != nullptr) { + child->m_group = nullptr; nextSibling = child->nextSibling(); delete child; child = nextSibling; } - m_firstChild = 0; - m_lastChild = 0; + m_firstChild = nullptr; + m_lastChild = nullptr; } void QAnimationGroupJob::resetUncontrolledAnimationsFinishTime() diff --git a/src/qml/animations/qanimationgroupjob_p.h b/src/qml/animations/qanimationgroupjob_p.h index 148cb0c098..44250079c7 100644 --- a/src/qml/animations/qanimationgroupjob_p.h +++ b/src/qml/animations/qanimationgroupjob_p.h @@ -92,8 +92,8 @@ protected: private: //definition - QAbstractAnimationJob *m_firstChild; - QAbstractAnimationJob *m_lastChild; + QAbstractAnimationJob *m_firstChild = nullptr; + QAbstractAnimationJob *m_lastChild = nullptr; }; QT_END_NAMESPACE diff --git a/src/qml/animations/qcontinuinganimationgroupjob.cpp b/src/qml/animations/qcontinuinganimationgroupjob.cpp index 02dcaf1313..10096bf19c 100644 --- a/src/qml/animations/qcontinuinganimationgroupjob.cpp +++ b/src/qml/animations/qcontinuinganimationgroupjob.cpp @@ -43,7 +43,6 @@ QT_BEGIN_NAMESPACE QContinuingAnimationGroupJob::QContinuingAnimationGroupJob() - : QAnimationGroupJob() { } diff --git a/src/qml/animations/qparallelanimationgroupjob_p.h b/src/qml/animations/qparallelanimationgroupjob_p.h index 2d48686335..0265fe3274 100644 --- a/src/qml/animations/qparallelanimationgroupjob_p.h +++ b/src/qml/animations/qparallelanimationgroupjob_p.h @@ -78,8 +78,8 @@ private: void applyGroupState(QAbstractAnimationJob *animation); //state - int m_previousLoop; - int m_previousCurrentTime; + int m_previousLoop = 0; + int m_previousCurrentTime = 0; }; QT_END_NAMESPACE diff --git a/src/qml/animations/qpauseanimationjob.cpp b/src/qml/animations/qpauseanimationjob.cpp index 27175580dc..0652ed578b 100644 --- a/src/qml/animations/qpauseanimationjob.cpp +++ b/src/qml/animations/qpauseanimationjob.cpp @@ -42,8 +42,7 @@ QT_BEGIN_NAMESPACE QPauseAnimationJob::QPauseAnimationJob(int duration) - : QAbstractAnimationJob() - , m_duration(duration) + : m_duration(duration) { m_isPause = true; } diff --git a/src/qml/animations/qsequentialanimationgroupjob.cpp b/src/qml/animations/qsequentialanimationgroupjob.cpp index 25d31e4042..22e20d9268 100644 --- a/src/qml/animations/qsequentialanimationgroupjob.cpp +++ b/src/qml/animations/qsequentialanimationgroupjob.cpp @@ -45,7 +45,7 @@ QT_BEGIN_NAMESPACE QSequentialAnimationGroupJob::QSequentialAnimationGroupJob() : QAnimationGroupJob() - , m_currentAnimation(0) + , m_currentAnimation(nullptr) , m_previousLoop(0) { } @@ -87,7 +87,7 @@ QSequentialAnimationGroupJob::AnimationIndex QSequentialAnimationGroupJob::index Q_ASSERT(firstChild()); AnimationIndex ret; - QAbstractAnimationJob *anim = 0; + QAbstractAnimationJob *anim = nullptr; int duration = 0; for (anim = firstChild(); anim; anim = anim->nextSibling()) { @@ -283,7 +283,7 @@ void QSequentialAnimationGroupJob::setCurrentAnimation(QAbstractAnimationJob *an { if (!anim) { Q_ASSERT(!firstChild()); - m_currentAnimation = 0; + m_currentAnimation = nullptr; return; } @@ -364,7 +364,7 @@ void QSequentialAnimationGroupJob::uncontrolledAnimationFinished(QAbstractAnimat void QSequentialAnimationGroupJob::animationInserted(QAbstractAnimationJob *anim) { - if (m_currentAnimation == 0) + if (m_currentAnimation == nullptr) setCurrentAnimation(firstChild()); // initialize the current animation if (m_currentAnimation == anim->nextSibling() @@ -393,7 +393,7 @@ void QSequentialAnimationGroupJob::animationRemoved(QAbstractAnimationJob *anim, else if (prev) setCurrentAnimation(prev); else// case all animations were removed - setCurrentAnimation(0); + setCurrentAnimation(nullptr); } // duration of the previous animations up to the current animation diff --git a/src/qml/animations/qsequentialanimationgroupjob_p.h b/src/qml/animations/qsequentialanimationgroupjob_p.h index 760445c8c6..13f9806be1 100644 --- a/src/qml/animations/qsequentialanimationgroupjob_p.h +++ b/src/qml/animations/qsequentialanimationgroupjob_p.h @@ -79,12 +79,12 @@ protected: private: struct AnimationIndex { - AnimationIndex() : afterCurrent(false), timeOffset(0), animation(0) {} + AnimationIndex() {} // AnimationIndex points to the animation at timeOffset, skipping 0 duration animations. // Note that the index semantic is slightly different depending on the direction. - bool afterCurrent; //whether animation is before or after m_currentAnimation //TODO: make enum Before/After/Same - int timeOffset; // time offset when the animation at index starts. - QAbstractAnimationJob *animation; //points to the animation at timeOffset + bool afterCurrent = false; //whether animation is before or after m_currentAnimation //TODO: make enum Before/After/Same + int timeOffset = 0; // time offset when the animation at index starts. + QAbstractAnimationJob *animation = nullptr; //points to the animation at timeOffset }; int animationActualTotalDuration(QAbstractAnimationJob *anim) const; @@ -105,8 +105,8 @@ private: void advanceForwards(const AnimationIndex &newAnimationIndex); //state - QAbstractAnimationJob *m_currentAnimation; - int m_previousLoop; + QAbstractAnimationJob *m_currentAnimation = nullptr; + int m_previousLoop = 0; }; QT_END_NAMESPACE |