summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qgesture.h
diff options
context:
space:
mode:
authorDenis Dzyubenko <denis.dzyubenko@nokia.com>2009-05-08 16:46:44 (GMT)
committerDenis Dzyubenko <denis.dzyubenko@nokia.com>2009-05-11 14:52:04 (GMT)
commit81a64345258f2f2ad5cf77355f7ecbd3ebad9734 (patch)
tree6fa024d2cadedae9ecd4e1718f704281112a78b5 /src/gui/kernel/qgesture.h
parent0edf9fc7ede35995ec37197b5fb5ef92a4ccf60f (diff)
downloadQt-81a64345258f2f2ad5cf77355f7ecbd3ebad9734.zip
Qt-81a64345258f2f2ad5cf77355f7ecbd3ebad9734.tar.gz
Qt-81a64345258f2f2ad5cf77355f7ecbd3ebad9734.tar.bz2
Improved gesture propagation.
Each gesture can now be accepted separately and not accepted gestures will be propagated to parent widget that are subscribed to them. Added an internal flag to specify that gesture is a "singleshot" - aka if the gesture is not continious and will not have a GestureStarted state, but only GestureFinished. Asynchronous gestures still need to fixed, as well as QGraphicsView.
Diffstat (limited to 'src/gui/kernel/qgesture.h')
-rw-r--r--src/gui/kernel/qgesture.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/gui/kernel/qgesture.h b/src/gui/kernel/qgesture.h
index da1bc90..d220232 100644
--- a/src/gui/kernel/qgesture.h
+++ b/src/gui/kernel/qgesture.h
@@ -82,6 +82,12 @@ public:
uint duration, Qt::GestureState state);
virtual ~QGesture();
+ inline void setAccepted(bool accepted) { m_accept = accepted; }
+ inline bool isAccepted() const { return m_accept; }
+
+ inline void accept() { m_accept = true; }
+ inline void ignore() { m_accept = false; }
+
QString type() const;
Qt::GestureState state() const;
@@ -100,6 +106,8 @@ protected:
virtual void translate(const QPoint &offset);
private:
+ ushort m_accept : 1;
+
friend class QGestureManager;
friend class QApplication;
friend class QGestureRecognizerPan;