summaryrefslogtreecommitdiffstats
path: root/src/declarative/util/qdeclarativebehavior.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/declarative/util/qdeclarativebehavior.cpp')
-rw-r--r--src/declarative/util/qdeclarativebehavior.cpp12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/declarative/util/qdeclarativebehavior.cpp b/src/declarative/util/qdeclarativebehavior.cpp
index 1e000df..7181777 100644
--- a/src/declarative/util/qdeclarativebehavior.cpp
+++ b/src/declarative/util/qdeclarativebehavior.cpp
@@ -47,15 +47,12 @@
#include <qdeclarativecontext.h>
#include <qdeclarativeinfo.h>
#include <qdeclarativeproperty_p.h>
-
-#include <QtCore/qparallelanimationgroup.h>
+#include <qdeclarativeguard_p.h>
#include <private/qobject_p.h>
QT_BEGIN_NAMESPACE
-
-
class QDeclarativeBehaviorPrivate : public QObjectPrivate
{
Q_DECLARE_PUBLIC(QDeclarativeBehavior)
@@ -64,7 +61,7 @@ public:
QDeclarativeProperty property;
QVariant currentValue;
- QDeclarativeAbstractAnimation *animation;
+ QDeclarativeGuard<QDeclarativeAbstractAnimation> animation;
bool enabled;
};
@@ -176,11 +173,10 @@ void QDeclarativeBehavior::write(const QVariant &value)
actions << action;
QList<QDeclarativeProperty> after;
- if (d->animation)
- d->animation->transition(actions, after, QDeclarativeAbstractAnimation::Forward);
+ d->animation->transition(actions, after, QDeclarativeAbstractAnimation::Forward);
d->animation->qtAnimation()->start();
if (!after.contains(d->property))
- QDeclarativePropertyPrivate::write(d->property, value, QDeclarativePropertyPrivate::BypassInterceptor | QDeclarativePropertyPrivate::DontRemoveBinding);
+ QDeclarativePropertyPrivate::write(d->property, value, QDeclarativePropertyPrivate::BypassInterceptor | QDeclarativePropertyPrivate::DontRemoveBinding);
}
void QDeclarativeBehavior::setTarget(const QDeclarativeProperty &property)