diff options
| author | Andreas Buhr <andreas@andreasbuhr.de> | 2021-01-14 16:03:32 +0100 |
|---|---|---|
| committer | Andreas Buhr <andreas@andreasbuhr.de> | 2021-03-30 14:04:19 +0100 |
| commit | 702b00bc8bfdc51592a01c9b7ed5939d85a7e192 (patch) | |
| tree | da99df3515d087d1d7d61f4278a74e128896a910 /src/quick/util/qquickanimation.cpp | |
| parent | 8deb1b279fad2b10598af0870dd3b0d99f5ef128 (diff) | |
Consistent naming for (to|from)Is(Defined|Sourced) in animations
To store whether "from" and "to" values are defined and/or sourced,
QQuickPathAnimationUpdater used fromDefined format,
QQuickAbstractAnimationPrivate used fromIsDefined format,
QQuickAnimationPropertyUpdater used fromIsDefined format,
QQuickAnimatorPrivate used isFromDefined format,
QQuickBulkValueAnimator used fromDefined format,
QQuickAnimationPropertyUpdater used fromDefined format.
This patch changes all these to use the variable names
"fromIsDefined", "fromIsSourced", and "toIsDefined".
This makes the code more readable.
Pick-to: 6.0 5.15
Change-Id: Ia6c228208eb651247b0ba70f83afadb5b1027049
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src/quick/util/qquickanimation.cpp')
| -rw-r--r-- | src/quick/util/qquickanimation.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/quick/util/qquickanimation.cpp b/src/quick/util/qquickanimation.cpp index 69a056a1e3..28cea4b93d 100644 --- a/src/quick/util/qquickanimation.cpp +++ b/src/quick/util/qquickanimation.cpp @@ -1990,7 +1990,7 @@ void QQuickPropertyAnimationPrivate::convertVariant(QVariant &variant, QMetaType } QQuickBulkValueAnimator::QQuickBulkValueAnimator() - : QAbstractAnimationJob(), animValue(nullptr), fromSourced(nullptr), m_duration(250) + : QAbstractAnimationJob(), animValue(nullptr), fromIsSourced(nullptr), m_duration(250) { } @@ -2020,8 +2020,8 @@ void QQuickBulkValueAnimator::updateCurrentTime(int currentTime) void QQuickBulkValueAnimator::topLevelAnimationLoopChanged() { //check for new from every top-level loop (when the top level animation is started and all subsequent loops) - if (fromSourced) - *fromSourced = false; + if (fromIsSourced) + *fromIsSourced = false; QAbstractAnimationJob::topLevelAnimationLoopChanged(); } @@ -2590,7 +2590,7 @@ void QQuickAnimationPropertyUpdater::setValue(qreal v) if (v == 1.) { QQmlPropertyPrivate::write(action.property, action.toValue, QQmlPropertyData::BypassInterceptor | QQmlPropertyData::DontRemoveBinding); } else { - if (!fromSourced && !fromDefined) { + if (!fromIsSourced && !fromIsDefined) { action.fromValue = action.property.read(); if (interpolatorType) { QQuickPropertyAnimationPrivate::convertVariant(action.fromValue, QMetaType(interpolatorType)); @@ -2610,7 +2610,7 @@ void QQuickAnimationPropertyUpdater::setValue(qreal v) return; } wasDeleted = nullptr; - fromSourced = true; + fromIsSourced = true; } void QQuickAnimationPropertyUpdater::debugUpdater(QDebug d, int indentLevel) const @@ -2754,11 +2754,11 @@ QAbstractAnimationJob* QQuickPropertyAnimation::transition(QQuickStateActions &a data->interpolatorType = d->interpolatorType; data->interpolator = d->interpolator; data->reverse = direction == Backward ? true : false; - data->fromSourced = false; - data->fromDefined = d->fromIsDefined; + data->fromIsSourced = false; + data->fromIsDefined = d->fromIsDefined; data->actions = dataActions; animator->setAnimValue(data); - animator->setFromSourcedValue(&data->fromSourced); + animator->setFromIsSourcedValue(&data->fromIsSourced); d->actions = &data->actions; //remove this? } |
