8#include "private/qcontinuinganimationgroupjob_p.h"
12#include <private/qqmlproperty_p.h>
14#include <private/qqmlglobal_p.h>
16#include <QtCore/qdebug.h>
19#define DELAY_STOP_TIMER_INTERVAL 32
43 trackVelocity(0), initialValue(0),
invert(
false), finalDuration(-1), lastTime(0),
52 delete delayedStopTimer;
53 if (animationTemplate) {
63 if (
it.value() ==
this) {
101void QSmoothedAnimation::delayedStop()
104 delayedStopTimer->
start();
112bool QSmoothedAnimation::recalc()
114 s =
to - initialValue;
130 finalDuration =
qCeil(tf * 1000.0);
151 a = (
s - (vi * tf - 0.5 * vi * ta)) / (tf * ta - ta * ta);
156 sp = vi * ta + 0.5 *
a * tp * tp;
157 sd = sp + vp * (tf - 2 * ta);
160 qreal c1 = 0.25 * tf * tf;
162 qreal c3 = -0.25 * vi * vi;
166 qreal tp1 = 0.5 * tf - 0.5 * vi /
a1;
169 qreal sp1 = 0.5 *
a1 * tp1 * tp1 + vi * tp1;
182qreal QSmoothedAnimation::easeFollow(
qreal time_seconds)
185 if (time_seconds < tp) {
187 value = 0.5 *
a * time_seconds * time_seconds + vi * time_seconds;
188 }
else if (time_seconds < td) {
191 value = sp + time_seconds * vp;
192 }
else if (time_seconds < tf) {
195 value = sd - 0.5 * d * time_seconds * time_seconds + vp * time_seconds;
233 delayedStopTimer->
stop();
235 initialValue =
target.read().toReal();
238 if (
to == initialValue) {
244 ((!
invert) == ((initialValue -
to) > 0));
349 it.value()->clearTemplate();
377 for (
int i = 0;
i < dataActions.
size();
i++) {
380 if (!
d->activeAnimations.contains(dataActions[
i].property)) {
382 d->activeAnimations.insert(dataActions[
i].
property, ease);
383 ease->
target = dataActions[
i].property;
386 ease =
d->activeAnimations.value(dataActions[
i].
property);
391 ease->
to = dataActions[
i].toValue.toReal();
406 const auto copy =
d->activeAnimations;
409 ease->clearTemplate();
410 d->activeAnimations.remove(ease->target);
440 if (
d->anim->reversingMode ==
m)
443 d->anim->reversingMode =
m;
445 d->updateRunningAnimations();
461 return d->anim->userDuration;
472 d->updateRunningAnimations();
478 return d->anim->velocity;
496 if (
d->anim->velocity ==
v)
499 d->anim->velocity =
v;
501 d->updateRunningAnimations();
517 return d->anim->maximumEasingTime;
523 if(
v ==
d->anim->maximumEasingTime)
525 d->anim->maximumEasingTime =
v;
527 d->updateRunningAnimations();
532#include "moc_qquicksmoothedanimation_p_p.cpp"
534#include "moc_qquicksmoothedanimation_p.cpp"
void appendAnimation(QAbstractAnimationJob *animation)
iterator begin()
Returns an \l{STL-style iterators}{STL-style iterator} pointing to the first item in the hash.
iterator find(const Key &key)
Returns an iterator pointing to the item with the key in the hash.
iterator erase(const_iterator it)
iterator end() noexcept
Returns an \l{STL-style iterators}{STL-style iterator} pointing to the imaginary item after the last ...
qsizetype size() const noexcept
bool isEmpty() const noexcept
static QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
\threadsafe
static bool write(QObject *, const QQmlPropertyData &, const QVariant &, const QQmlRefPointer< QQmlContextData > &, QQmlPropertyData::WriteFlags flags={})
QAbstractAnimationJob * initInstance(QAbstractAnimationJob *animation)
virtual void setDuration(int)
QQuickStateActions createTransitionActions(QQuickStateActions &actions, QQmlProperties &modified, QObject *defaultTarget=nullptr)
QHash< QQmlProperty, QSmoothedAnimation * > activeAnimations
QQuickSmoothedAnimationPrivate()
QSmoothedAnimation * anim
~QQuickSmoothedAnimationPrivate()
void updateRunningAnimations()
int duration() const override
\qmlproperty int QtQuick::SmoothedAnimation::duration
void setReversingMode(ReversingMode)
void maximumEasingTimeChanged()
QAbstractAnimationJob * transition(QQuickStateActions &actions, QQmlProperties &modified, TransitionDirection direction, QObject *defaultTarget=nullptr) override
void setDuration(int) override
ReversingMode reversingMode
void reversingModeChanged()
QQuickSmoothedAnimation(QObject *parent=nullptr)
\qmltype SmoothedAnimation \instantiates QQuickSmoothedAnimation \inqmlmodule QtQuick\inherits Number...
void setVelocity(qreal)
\qmlproperty real QtQuick::SmoothedAnimation::velocity
void setMaximumEasingTime(int)
bool contains(const T &value) const
iterator insert(const T &value)
QSmoothedAnimationTimer(QSmoothedAnimation *animation, QObject *parent=nullptr)
~QSmoothedAnimationTimer()
void updateState(QAbstractAnimationJob::State, QAbstractAnimationJob::State) override
void updateCurrentTime(int) override
void debugAnimation(QDebug d) const override
QQuickSmoothedAnimation::ReversingMode reversingMode
QSmoothedAnimation(QQuickSmoothedAnimationPrivate *=nullptr)
int duration() const override
void setSingleShot(bool singleShot)
void start(int msec)
Starts or restarts the timer with a timeout interval of msec milliseconds.
void setInterval(int msec)
bool isActive() const
Returns true if the timer is running (pending); otherwise returns false.
void stop()
Stops the timer.
void timeout(QPrivateSignal)
This signal is emitted when the timer times out.
QSet< QString >::iterator it
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.
static jboolean copy(JNIEnv *, jobject)
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
qfloat16 qSqrt(qfloat16 f)
GLsizei const GLfloat * v
[13]
GLboolean GLboolean GLboolean GLboolean a
[7]
#define DELAY_STOP_TIMER_INTERVAL
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent