diff options
author | Denis Dzyubenko <denis.dzyubenko@nokia.com> | 2009-09-01 12:25:42 (GMT) |
---|---|---|
committer | Denis Dzyubenko <denis.dzyubenko@nokia.com> | 2009-09-03 09:30:54 (GMT) |
commit | 466bc1ed4bf0c466e54732b2f8f7a16a34b716a8 (patch) | |
tree | d84578adfd77b2dd72f16277db3e0c3f1339528e /src/gui/kernel/qstandardgestures.h | |
parent | a1a0ea71d8861e2b794f2f9b55447d50fc520de3 (diff) | |
download | Qt-466bc1ed4bf0c466e54732b2f8f7a16a34b716a8.zip Qt-466bc1ed4bf0c466e54732b2f8f7a16a34b716a8.tar.gz Qt-466bc1ed4bf0c466e54732b2f8f7a16a34b716a8.tar.bz2 |
Improved the gesture api.
Made properties in QPanGesture and QPinchGesture more consistent - all of them
have value, lastValue and totalValue. Documented that totalValue means the
value from the beginning of the gesture, while the 'value' - from the beginning
of the current sequence. This is especially useful on Windows when you zoom
with two fingers and then release one finger and touch again to continue
zooming.
Also added a workaround for native Rotate gesture on Windows which contain a
'bad' value in the first WM_GESTURE message in every gesture sequence.
Reviewed-by: Bradley T. Hughes
Diffstat (limited to 'src/gui/kernel/qstandardgestures.h')
-rw-r--r-- | src/gui/kernel/qstandardgestures.h | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/gui/kernel/qstandardgestures.h b/src/gui/kernel/qstandardgestures.h index 33166fe..c6dfa92 100644 --- a/src/gui/kernel/qstandardgestures.h +++ b/src/gui/kernel/qstandardgestures.h @@ -61,6 +61,7 @@ class Q_GUI_EXPORT QPanGesture : public QGesture Q_PROPERTY(QSizeF totalOffset READ totalOffset) Q_PROPERTY(QSizeF lastOffset READ lastOffset) + Q_PROPERTY(QSizeF offset READ offset) public: QPanGesture(QWidget *gestureTarget, QObject *parent = 0); @@ -69,6 +70,7 @@ public: QSizeF totalOffset() const; QSizeF lastOffset() const; + QSizeF offset() const; protected: void reset(); @@ -87,11 +89,13 @@ class Q_GUI_EXPORT QPinchGesture : public QGesture Q_OBJECT Q_DECLARE_PRIVATE(QPinchGesture) - Q_PROPERTY(qreal scaleFactor READ scaleFactor) + Q_PROPERTY(qreal totalScaleFactor READ totalScaleFactor) Q_PROPERTY(qreal lastScaleFactor READ lastScaleFactor) + Q_PROPERTY(qreal scaleFactor READ scaleFactor) - Q_PROPERTY(qreal rotationAngle READ rotationAngle) + Q_PROPERTY(qreal totalRotationAngle READ totalRotationAngle) Q_PROPERTY(qreal lastRotationAngle READ lastRotationAngle) + Q_PROPERTY(qreal rotationAngle READ rotationAngle) Q_PROPERTY(QPointF startCenterPoint READ startCenterPoint) Q_PROPERTY(QPointF lastCenterPoint READ lastCenterPoint) @@ -107,11 +111,13 @@ public: QPointF lastCenterPoint() const; QPointF centerPoint() const; - qreal scaleFactor() const; + qreal totalScaleFactor() const; qreal lastScaleFactor() const; + qreal scaleFactor() const; - qreal rotationAngle() const; + qreal totalRotationAngle() const; qreal lastRotationAngle() const; + qreal rotationAngle() const; private: bool event(QEvent *event); |