Assert that setCurrentAnimation has the assumed side effect
setCurrentAnimation(0) is expected to set the currentAnimation pointer - which it does, as long as there are any animations. Fixes static analyzer warning 106daf11ddfe9bb4fa7cf98c9097962c Pick-to: 6.1 Change-Id: I3739bcfda103db391d21f135485f0b700c48ead1 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
This commit is contained in:
parent
e38b55c47c
commit
976d8b1f74
@ -503,8 +503,10 @@ void QSequentialAnimationGroupPrivate::_q_uncontrolledAnimationFinished()
|
|||||||
*/
|
*/
|
||||||
void QSequentialAnimationGroupPrivate::animationInsertedAt(int index)
|
void QSequentialAnimationGroupPrivate::animationInsertedAt(int index)
|
||||||
{
|
{
|
||||||
if (currentAnimation == nullptr)
|
if (currentAnimation == nullptr) {
|
||||||
setCurrentAnimation(0); // initialize the current animation
|
setCurrentAnimation(0); // initialize the current animation
|
||||||
|
Q_ASSERT(currentAnimation);
|
||||||
|
}
|
||||||
|
|
||||||
if (currentAnimationIndex == index
|
if (currentAnimationIndex == index
|
||||||
&& currentAnimation->currentTime() == 0 && currentAnimation->currentLoop() == 0) {
|
&& currentAnimation->currentTime() == 0 && currentAnimation->currentLoop() == 0) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user