From a35d64024103df9150bbbc21298bee6e0ab8cd93 Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Tue, 13 Oct 2009 09:55:45 +1000 Subject: Readd basic Behavior documentation. --- src/declarative/extra/qmlbehavior.cpp | 36 +++++++++++++++++++++++++++++++---- 1 file changed, 32 insertions(+), 4 deletions(-) diff --git a/src/declarative/extra/qmlbehavior.cpp b/src/declarative/extra/qmlbehavior.cpp index e30bd39..1cf0d38 100644 --- a/src/declarative/extra/qmlbehavior.cpp +++ b/src/declarative/extra/qmlbehavior.cpp @@ -62,11 +62,43 @@ public: QmlAbstractAnimation *animation; }; +/*! + \qmlclass Behavior QmlBehavior + \brief The Behavior element allows you to specify a default animation for a property change. + + In example below, the rect will use a bounce easing curve over 200 millisecond for any changes to its y property: + \code + Rectangle { + width: 20; height: 20 + color: "#00ff00" + y: 200 //initial value + y: Behavior { + NumberAnimation { + easing: "easeOutBounce(amplitude:100)" + duration: 200 + } + } + } + \endcode +*/ + + QmlBehavior::QmlBehavior(QObject *parent) : QObject(*(new QmlBehaviorPrivate), parent) { } +QmlBehavior::~QmlBehavior() +{ +} + +/*! + \qmlproperty Animation Behavior::animation + \default + + The animation to use when the behavior is triggered. +*/ + QmlAbstractAnimation *QmlBehavior::animation() { Q_D(QmlBehavior); @@ -86,10 +118,6 @@ void QmlBehavior::setAnimation(QmlAbstractAnimation *animation) d->animation->setTarget(d->property); } -QmlBehavior::~QmlBehavior() -{ -} - void QmlBehavior::write(const QVariant &value) { Q_D(QmlBehavior); -- cgit v0.12