diff options
author | Thomas Zander <t.zander@nokia.com> | 2009-10-27 14:31:16 (GMT) |
---|---|---|
committer | Thomas Zander <thomas.zander@trolltech.com> | 2009-10-28 11:37:04 (GMT) |
commit | 4470801f73b86d3ee06a866fbbdafcaeb9f294a6 (patch) | |
tree | 0b587d391267b55b369c7c7439a7033bab087918 /src/gui/kernel/qgesture.h | |
parent | 9a9cd7765bfe879b53488fe18bba75425e4c5c61 (diff) | |
download | Qt-4470801f73b86d3ee06a866fbbdafcaeb9f294a6.zip Qt-4470801f73b86d3ee06a866fbbdafcaeb9f294a6.tar.gz Qt-4470801f73b86d3ee06a866fbbdafcaeb9f294a6.tar.bz2 |
Introduce QGesture::GestureCancelPolicy, a way to auto-cancel gestures
On accepting one gesture Qt can automatically cancel other gestures
that belong to other targets. The policy is normally set to not cancel
any other gestures and can be set to cancel all active gestures in the
context. For example for all child widgets.
Reviewed-By: Denis Dzyubenko
Diffstat (limited to 'src/gui/kernel/qgesture.h')
-rw-r--r-- | src/gui/kernel/qgesture.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/gui/kernel/qgesture.h b/src/gui/kernel/qgesture.h index 6469959..524d26e 100644 --- a/src/gui/kernel/qgesture.h +++ b/src/gui/kernel/qgesture.h @@ -65,6 +65,7 @@ class Q_GUI_EXPORT QGesture : public QObject Q_PROPERTY(Qt::GestureState state READ state) Q_PROPERTY(Qt::GestureType gestureType READ gestureType) + Q_PROPERTY(QGesture::GestureCancelPolicy gestureCancelPolicy READ gestureCancelPolicy WRITE setGestureCancelPolicy) Q_PROPERTY(QPointF hotSpot READ hotSpot WRITE setHotSpot RESET unsetHotSpot) Q_PROPERTY(bool hasHotSpot READ hasHotSpot) @@ -81,6 +82,14 @@ public: bool hasHotSpot() const; void unsetHotSpot(); + enum GestureCancelPolicy { + CancelNone = 0, + CancelAllInContext + }; + + void setGestureCancelPolicy(GestureCancelPolicy policy); + GestureCancelPolicy gestureCancelPolicy() const; + protected: QGesture(QGesturePrivate &dd, QObject *parent); @@ -208,6 +217,7 @@ public: QT_END_NAMESPACE +Q_DECLARE_METATYPE(QGesture::GestureCancelPolicy) QT_END_HEADER #endif // QGESTURE_H |