aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Brasser <michael.brasser@nokia.com>2011-09-23 09:44:09 +1000
committerQt by Nokia <qt-info@nokia.com>2011-09-23 02:22:26 +0200
commit3af0f98a79f223988854e313c198f5fdf3ff5e3b (patch)
tree51128fd87af1a8702a47f2cfdd340655b7584f3e
parent2bed35935d1e831eaaa944014d455bdb32e88d8a (diff)
Further delay animation creation in Behavior.
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>
-rw-r--r--src/declarative/util/qdeclarativebehavior.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/declarative/util/qdeclarativebehavior.cpp b/src/declarative/util/qdeclarativebehavior.cpp
index 84636e4701..550b8a3aa1 100644
--- a/src/declarative/util/qdeclarativebehavior.cpp
+++ b/src/declarative/util/qdeclarativebehavior.cpp
@@ -175,8 +175,10 @@ void QDeclarativeBehavior::setEnabled(bool enabled)
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;