summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/declarative/extra/qmlbehavior.cpp36
1 files 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);