diff options
author | Zeno Albisser <zeno.albisser@nokia.com> | 2010-09-10 05:04:06 -0400 |
---|---|---|
committer | Zeno Albisser <zeno.albisser@nokia.com> | 2010-09-13 10:42:41 -0400 |
commit | d65259a3444a08919f1f19b9d2dcbe9b182752aa (patch) | |
tree | 18d13f117e1abba4725abc8a421e97857bdd1a03 | |
parent | dc343981c65af9d279a08ae4a664ec664dbb3cea (diff) | |
download | qt4-tools-d65259a3444a08919f1f19b9d2dcbe9b182752aa.tar.gz |
Added velocity property to the QPanGesture.
Reviewed-by: Denis Dzyubenko
-rw-r--r-- | src/gui/kernel/qgesture.h | 2 | ||||
-rw-r--r-- | src/gui/kernel/qgesture_p.h | 9 |
2 files changed, 10 insertions, 1 deletions
diff --git a/src/gui/kernel/qgesture.h b/src/gui/kernel/qgesture.h index 1ba6e10dbb..2e279b01fe 100644 --- a/src/gui/kernel/qgesture.h +++ b/src/gui/kernel/qgesture.h @@ -112,6 +112,8 @@ class Q_GUI_EXPORT QPanGesture : public QGesture Q_PROPERTY(QPointF offset READ offset WRITE setOffset) Q_PROPERTY(QPointF delta READ delta STORED false) Q_PROPERTY(qreal acceleration READ acceleration WRITE setAcceleration) + Q_PRIVATE_PROPERTY(QPanGesture::d_func(), qreal horizontalVelocity READ horizontalVelocity WRITE setHorizontalVelocity) + Q_PRIVATE_PROPERTY(QPanGesture::d_func(), qreal verticalVelocity READ verticalVelocity WRITE setVerticalVelocity) public: QPanGesture(QObject *parent = 0); diff --git a/src/gui/kernel/qgesture_p.h b/src/gui/kernel/qgesture_p.h index 7d6ea8708a..baf0d33d2b 100644 --- a/src/gui/kernel/qgesture_p.h +++ b/src/gui/kernel/qgesture_p.h @@ -88,14 +88,21 @@ class QPanGesturePrivate : public QGesturePrivate public: QPanGesturePrivate() - : acceleration(0) + : acceleration(0), xVelocity(0), yVelocity(0) { } + qreal horizontalVelocity() const { return xVelocity; } + void setHorizontalVelocity(qreal value) { xVelocity = value; } + qreal verticalVelocity() const { return yVelocity; } + void setVerticalVelocity(qreal value) { yVelocity = value; } + QPointF lastOffset; QPointF offset; QPoint startPosition; qreal acceleration; + qreal xVelocity; + qreal yVelocity; }; class QPinchGesturePrivate : public QGesturePrivate |