Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qcontinuinganimationgroupjob.cpp
Go to the documentation of this file.
1// Copyright (C) 2016 Jolla Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#include "private/qcontinuinganimationgroupjob_p.h"
5#include "private/qanimationjobutil_p.h"
6
8
10{
11}
12
14{
15}
16
18{
21 if (animation->state() == state()) {
23 }
24 }
25}
26
29{
31
32 switch (newState) {
33 case Stopped:
35 animation->stop();
36 break;
37 case Paused:
39 if (animation->isRunning())
41 break;
42 case Running:
43 if (m_children.isEmpty()) {
44 stop();
45 return;
46 }
51 }
52 break;
53 }
54}
55
57{
58 if (!isStopped()) {
61 }
62}
63
65{
66 Q_ASSERT(animation && (animation->duration() == -1));
67 int uncontrolledRunningCount = 0;
68
70 if (child == animation)
73 ++uncontrolledRunningCount;
74 }
75
76 if (uncontrolledRunningCount > 0)
77 return;
78
80 stop();
81}
82
84{
85 d << "ContinuingAnimationGroupJob(" << Qt::hex << (const void *) this << Qt::dec << ")";
86
88}
89
91
virtual void updateState(QAbstractAnimationJob::State newState, QAbstractAnimationJob::State oldState)
QAbstractAnimationJob::State state() const
QAbstractAnimationJob::Direction m_direction
QAbstractAnimationJob::Direction direction() const
State state
state of the animation.
void stop()
Stops the animation.
void start(QAbstractAnimation::DeletionPolicy policy=KeepWhenStopped)
Starts the animation.
void setDirection(Direction direction)
int currentTime
the current time and progress of the animation
void setCurrentTime(int msecs)
void pause()
Pauses the animation.
void resetUncontrolledAnimationFinishTime(QAbstractAnimationJob *anim)
int uncontrolledAnimationFinishTime(const QAbstractAnimationJob *anim) const
void debugChildren(QDebug d) const
void setUncontrolledAnimationFinishTime(QAbstractAnimationJob *anim, int time)
void debugAnimation(QDebug d) const override
void updateState(QAbstractAnimationJob::State newState, QAbstractAnimationJob::State oldState) override
void uncontrolledAnimationFinished(QAbstractAnimationJob *animation) override
void updateDirection(QAbstractAnimationJob::Direction direction) override
void updateCurrentTime(int currentTime) override
\inmodule QtCore
int duration
the duration of the animation
direction
void newState(QList< State > &states, const char *token, const char *lexem, bool pre)
Combined button and popup list for selecting options.
QTextStream & hex(QTextStream &stream)
Calls QTextStream::setIntegerBase(16) on stream and returns stream.
QTextStream & dec(QTextStream &stream)
Calls QTextStream::setIntegerBase(10) on stream and returns stream.
#define RETURN_IF_DELETED(func)
#define Q_ASSERT(cond)
Definition qrandom.cpp:47
QPropertyAnimation animation
[0]
QLayoutItem * child
[0]