diff options
author | Michael Brasser <michael.brasser@nokia.com> | 2012-01-19 12:24:03 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-01-27 06:23:26 +0100 |
commit | 9a15b7e1b0489d1573ce27c065f6722704df05d3 (patch) | |
tree | 6f587625578b0469dee3263b55ee3aacbd900a5e /src/quick/util | |
parent | 3bbe8fdbab9a1f2f3f8ca40d5e25e2d5c5fb1a75 (diff) |
Document PathInterpolator.
Change-Id: I8fb625fb6881af8d0928da3d487dcd659dc384f5
Reviewed-by: Yunqiao Yin <charles.yin@nokia.com>
Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
Diffstat (limited to 'src/quick/util')
-rw-r--r-- | src/quick/util/qdeclarativepathinterpolator.cpp | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/src/quick/util/qdeclarativepathinterpolator.cpp b/src/quick/util/qdeclarativepathinterpolator.cpp index 46038f9c0a..c954c23f6c 100644 --- a/src/quick/util/qdeclarativepathinterpolator.cpp +++ b/src/quick/util/qdeclarativepathinterpolator.cpp @@ -45,11 +45,30 @@ QT_BEGIN_NAMESPACE +/*! + \qmlclass PathInterpolator QQuickPathInterpolator + \inqmlmodule QtQuick 2 + \brief The PathInterpolator element provides a way to manually animate along a path. + + PathInterpolator provides \c x, \c y, and \c angle information for a particular \c progress + along a path. + + In the following example, we animate a green rectangle along a bezier path. + + \snippet doc/src/snippets/declarative/pathinterpolator.qml 0 +*/ + QDeclarativePathInterpolator::QDeclarativePathInterpolator(QObject *parent) : QObject(parent), _path(0), _x(0), _y(0), _angle(0), _progress(0) { } +/*! + \qmlproperty Path QtQuick2::PathInterpolator::path + This property holds the path to interpolate. + + For more information on defining a path see the \l Path documentation. +*/ QDeclarativePath *QDeclarativePathInterpolator::path() const { return _path; @@ -66,6 +85,16 @@ void QDeclarativePathInterpolator::setPath(QDeclarativePath *path) emit pathChanged(); } +/*! + \qmlproperty real QtQuick2::PathInterpolator::progress + This property holds the current progress along the path. + + Typical usage of PathInterpolator is to set the progress + (often via a NumberAnimation), and read the corresponding + values for x, y, and angle (often via bindings to these values). + + Progress ranges from 0.0 to 1.0. +*/ qreal QDeclarativePathInterpolator::progress() const { return _progress; @@ -80,6 +109,12 @@ void QDeclarativePathInterpolator::setProgress(qreal progress) _q_pathUpdated(); } +/*! + \qmlproperty real QtQuick2::PathInterpolator::x + \qmlproperty real QtQuick2::PathInterpolator::y + + These properties hold the position of the path at \l progress. +*/ qreal QDeclarativePathInterpolator::x() const { return _x; @@ -90,6 +125,13 @@ qreal QDeclarativePathInterpolator::y() const return _y; } +/*! + \qmlproperty real QtQuick2::PathInterpolator::angle + + This property holds the angle of the path tangent at \l progress. + + Angles are reported clockwise, with zero degrees at the 3 o'clock position. +*/ qreal QDeclarativePathInterpolator::angle() const { return _angle; |