summaryrefslogtreecommitdiffstats
path: root/src/declarative/extra
diff options
context:
space:
mode:
authorMichael Brasser <michael.brasser@nokia.com>2009-10-12 23:55:45 (GMT)
committerMichael Brasser <michael.brasser@nokia.com>2009-10-12 23:55:45 (GMT)
commita35d64024103df9150bbbc21298bee6e0ab8cd93 (patch)
treed4037b0bca140eb7d74fa99dc59556336c1d5d43 /src/declarative/extra
parent75485ced8520cbeeb67a93c0deb1e387caa7ef62 (diff)
downloadQt-a35d64024103df9150bbbc21298bee6e0ab8cd93.zip
Qt-a35d64024103df9150bbbc21298bee6e0ab8cd93.tar.gz
Qt-a35d64024103df9150bbbc21298bee6e0ab8cd93.tar.bz2
Readd basic Behavior documentation.
Diffstat (limited to 'src/declarative/extra')
-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);