diff options
Diffstat (limited to 'src/declarative/util/qmlfollow.cpp')
-rw-r--r-- | src/declarative/util/qmlfollow.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/declarative/util/qmlfollow.cpp b/src/declarative/util/qmlfollow.cpp index c841b85..01d8962 100644 --- a/src/declarative/util/qmlfollow.cpp +++ b/src/declarative/util/qmlfollow.cpp @@ -52,6 +52,7 @@ QML_DEFINE_TYPE(QmlFollow,Follow); class QmlFollowPrivate : public QObjectPrivate { + Q_DECLARE_PUBLIC(QmlFollow) public: QmlFollowPrivate() : sourceValue(0), maxVelocity(0), lastTime(0) @@ -86,6 +87,8 @@ public: void QmlFollowPrivate::tick(int time) { + Q_Q(QmlFollow); + int elapsed = time - lastTime; if (!elapsed) return; @@ -133,6 +136,7 @@ void QmlFollowPrivate::tick(int time) } lastTime = time; } + emit q->valueChanged(currentValue); property.write(currentValue); } @@ -288,6 +292,11 @@ void QmlFollow::setDamping(qreal damping) } /*! + \qmlproperty qreal Follow::followValue + The current value. +*/ + +/*! \qmlproperty bool Follow::enabled This property holds whether the target will track the source. */ @@ -306,4 +315,11 @@ void QmlFollow::setEnabled(bool enabled) else d->stop(); } + +qreal QmlFollow::value() const +{ + Q_D(const QmlFollow); + return d->currentValue; +} + QT_END_NAMESPACE |