summaryrefslogtreecommitdiffstats
path: root/src/declarative/extra
diff options
context:
space:
mode:
authorWarwick Allison <warwick.allison@nokia.com>2009-10-13 02:36:30 (GMT)
committerWarwick Allison <warwick.allison@nokia.com>2009-10-13 02:36:30 (GMT)
commit7a9dada31e570b2884c1c3c7a094ca9b1690c743 (patch)
tree5256ebe5de00ef0065f10cbfadd6d52e43f8ed5f /src/declarative/extra
parent5e31c0cae45bae6f66decfb37825ed5d445e49e4 (diff)
parentd39b7ce65f051da342dcc931e303a73339288c5e (diff)
downloadQt-7a9dada31e570b2884c1c3c7a094ca9b1690c743.zip
Qt-7a9dada31e570b2884c1c3c7a094ca9b1690c743.tar.gz
Qt-7a9dada31e570b2884c1c3c7a094ca9b1690c743.tar.bz2
Merge branch 'kinetic-declarativeui' of git@scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
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 f3eb014..654cb4e 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);