diff options
author | Warwick Allison <warwick.allison@nokia.com> | 2009-04-24 04:30:50 (GMT) |
---|---|---|
committer | Warwick Allison <warwick.allison@nokia.com> | 2009-04-24 04:30:50 (GMT) |
commit | be859f223b21ac21f889d278c30ddd653f9233fc (patch) | |
tree | a5abd71a2bda8d8d47bf9a302ac5548317d755cd /src/declarative/util | |
parent | 8493c181e19c9cd49ea71baac1fcda54d37dae94 (diff) | |
parent | 6ef6a8184ebb969f951a7c55127e9445eba64d35 (diff) | |
download | Qt-be859f223b21ac21f889d278c30ddd653f9233fc.zip Qt-be859f223b21ac21f889d278c30ddd653f9233fc.tar.gz Qt-be859f223b21ac21f889d278c30ddd653f9233fc.tar.bz2 |
Merge branch 'kinetic-declarativeui' of git@scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
Diffstat (limited to 'src/declarative/util')
-rw-r--r-- | src/declarative/util/qbindablemap.cpp | 3 | ||||
-rw-r--r-- | src/declarative/util/qmlfollow.cpp | 16 | ||||
-rw-r--r-- | src/declarative/util/qmlfollow.h | 6 |
3 files changed, 25 insertions, 0 deletions
diff --git a/src/declarative/util/qbindablemap.cpp b/src/declarative/util/qbindablemap.cpp index aea2a2c..341dd31 100644 --- a/src/declarative/util/qbindablemap.cpp +++ b/src/declarative/util/qbindablemap.cpp @@ -117,6 +117,9 @@ QBindableMap::QBindableMap(QObject *parent) m_mo = new QBindableMapMetaObject(this); } +/*! + Destroys the bindable map. +*/ QBindableMap::~QBindableMap() { } 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 diff --git a/src/declarative/util/qmlfollow.h b/src/declarative/util/qmlfollow.h index a609305..aac4c01 100644 --- a/src/declarative/util/qmlfollow.h +++ b/src/declarative/util/qmlfollow.h @@ -65,6 +65,7 @@ class Q_DECLARATIVE_EXPORT QmlFollow : public QmlPropertyValueSource, Q_PROPERTY(qreal damping READ damping WRITE setDamping); Q_PROPERTY(bool enabled READ enabled WRITE setEnabled); + Q_PROPERTY(qreal followValue READ value NOTIFY valueChanged); public: QmlFollow(QObject *parent=0); ~QmlFollow(); @@ -81,6 +82,11 @@ public: void setDamping(qreal damping); bool enabled() const; void setEnabled(bool enabled); + + qreal value() const; + +Q_SIGNALS: + void valueChanged(qreal); }; QML_DECLARE_TYPE(QmlFollow); |