Previously we always created the animation on the first call to write,
regardless of whether the Behavior was enabled. Now we delay until the
animation is needed.
Change-Id: I14a319a4f045050fe6a99427b7c3804ef078d48d
Reviewed-on: http://codereview.qt-project.org/5414
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Charles Yin <charles.yin@nokia.com>
void QDeclarativeBehavior::write(const QVariant &value)
{
Q_D(QDeclarativeBehavior);
- qmlExecuteDeferred(this);
- if (!d->animation || !d->enabled || !d->finalized) {
+ bool bypass = !d->enabled || !d->finalized;
+ if (!bypass)
+ qmlExecuteDeferred(this);
+ if (!d->animation || bypass) {
QDeclarativePropertyPrivate::write(d->property, value, QDeclarativePropertyPrivate::BypassInterceptor | QDeclarativePropertyPrivate::DontRemoveBinding);
d->targetValue = value;
return;