8#include <private/qqmlproperty_p.h>
9#include <private/qqmlengine_p.h>
10#include <private/qobject_p.h>
11#include <private/qquickanimation_p_p.h>
12#include <QtCore/qloggingcategory.h>
38 int returnDuration = 100;
41 bool completed =
false;
44 void resetOvershoot();
45 void onAnimationEnded();
78 qCDebug(lcBR) <<
t <<
"ms" <<
qRound(progress * 100) <<
"% easing" << easingValue <<
"->" <<
value;
87 qCDebug(lcBR) <<
"return animation done";
128 delete d->returnAnimationJob;
192 return d->minimumOvershoot;
242 return d->maximumOvershoot;
274 return d->overshootScale;
299 return d->currentOvershoot;
317 return d->peakOvershoot;
334 return d->overshootFilter;
361 if (
d->returnAnimationJob) {
362 qCDebug(lcBR) <<
"animation already in progress";
366 if (
d->returnDuration > 0)
371 if (
d->returnDuration > 0)
378 if (
d->returnAnimationJob) {
379 qCDebug(lcBR) <<
d->property.name() <<
"on" <<
d->property.object()
380 <<
": animating from" <<
d->returnAnimationJob->fromValue <<
"to" <<
d->returnAnimationJob->toValue;
381 d->returnAnimationJob->start();
384 qCDebug(lcBR) <<
d->property.name() <<
"on" <<
d->property.object() <<
": returned to" <<
d->property.read();
438 return d->returnDuration;
444 if (
d->returnDuration == duration)
446 d->returnDuration = duration;
463 bool conversionOk =
false;
466 qWarning() <<
"BoundaryRule doesn't work with non-numeric values:" <<
value;
477 d->targetValue =
d->easedOvershoot(rValue);
502 emit q->currentOvershootChanged();
506 emit q->peakOvershootChanged();
516 emit q->currentOvershootChanged();
520 emit q->peakOvershootChanged();
542 emit q->peakOvershootChanged();
546 emit q->currentOvershootChanged();
555 emit q->returnedToBounds();
560#include "moc_qquickboundaryrule_p.cpp"
qreal valueForProgress(qreal progress) const
Return the effective progress for the easing curve at progress.
static bool designerMode()
static bool write(QObject *, const QQmlPropertyData &, const QVariant &, const QQmlRefPointer< QQmlContextData > &, QQmlPropertyData::WriteFlags flags={})
The QQmlPropertyValueInterceptor class is inherited by property interceptors such as Behavior.
The QQmlProperty class abstracts accessing properties on objects created from QML.
void updateCurrentTime(int) override
int duration() const override
QQuickBoundaryReturnJob(QQuickBoundaryRulePrivate *br, qreal to)
void updateState(QAbstractAnimationJob::State newState, QAbstractAnimationJob::State oldState) override
QQuickBoundaryRulePrivate * boundaryRule
qreal easedOvershoot(qreal overshootingValue)
QQuickBoundaryRulePrivate()
QQuickBoundaryReturnJob * returnAnimationJob
QQuickBoundaryRule::OvershootFilter overshootFilter
void setTarget(const QQmlProperty &) override
Set the target property for the value interceptor.
void setMinimum(qreal minimum)
void overshootFilterChanged()
void classBegin() override
Invoked after class creation, but before any properties have been set.
OvershootFilter overshootFilter
void setMinimumOvershoot(qreal minimum)
void componentComplete() override
Invoked after the root component that caused this instantiation has completed construction.
void maximumOvershootChanged()
void setOvershootScale(qreal scale)
void returnDurationChanged()
void setEnabled(bool enabled)
void setMaximumOvershoot(qreal maximum)
QQuickBoundaryRule(QObject *parent=nullptr)
Defines a restriction on the range of values that can be set on a numeric property.
void write(const QVariant &value) override
This method will be called when a new value is assigned to the property being intercepted.
void setEasing(const QEasingCurve &easing)
void overshootScaleChanged()
void setMaximum(qreal maximum)
Q_INVOKABLE bool returnToBounds()
\qmlmethod bool Qt.labs.animation::BoundaryRule::returnToBounds
void setReturnDuration(int duration)
void setOvershootFilter(OvershootFilter overshootFilter)
void minimumOvershootChanged()
void newState(QList< State > &states, const char *token, const char *lexem, bool pre)
Combined button and popup list for selecting options.
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
bool qFuzzyCompare(qfloat16 p1, qfloat16 p2) noexcept
int qRound(qfloat16 d) noexcept
#define Q_LOGGING_CATEGORY(name,...)
#define qCDebug(category,...)
constexpr const T & qMin(const T &a, const T &b)
constexpr const T & qMax(const T &a, const T &b)
constexpr T qAbs(const T &t)
GLenum GLenum GLsizei const GLuint GLboolean enabled
GLdouble GLdouble GLdouble GLdouble q