diff options
author | Denis Dzyubenko <denis.dzyubenko@nokia.com> | 2009-02-26 14:39:00 (GMT) |
---|---|---|
committer | Denis Dzyubenko <denis.dzyubenko@nokia.com> | 2009-05-11 13:38:54 (GMT) |
commit | a3d8cfb1ee89e0600add864db53d67552820b95a (patch) | |
tree | d396d751de49d26c052b8752c94d5247503083e2 /src/gui/kernel/qevent.h | |
parent | 7396eea79c9464d0c246106834cbce02320e7989 (diff) | |
download | Qt-a3d8cfb1ee89e0600add864db53d67552820b95a.zip Qt-a3d8cfb1ee89e0600add864db53d67552820b95a.tar.gz Qt-a3d8cfb1ee89e0600add864db53d67552820b95a.tar.bz2 |
Merge of the maemo-gestures branch onto qt/4.5.0
This is a squashed merge of all of the changes in the maemo-gestures
branch on-top of the qt/4.5.0 branch.
Diffstat (limited to 'src/gui/kernel/qevent.h')
-rw-r--r-- | src/gui/kernel/qevent.h | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/src/gui/kernel/qevent.h b/src/gui/kernel/qevent.h index e9a1386..858e2ea 100644 --- a/src/gui/kernel/qevent.h +++ b/src/gui/kernel/qevent.h @@ -52,6 +52,10 @@ #include <QtGui/qmime.h> #include <QtGui/qdrag.h> #include <QtCore/qvariant.h> +#include <QtCore/qmap.h> +#include <QtCore/qset.h> +#include <QtCore/qsharedpointer.h> +#include <QtGui/qgesture.h> QT_BEGIN_HEADER @@ -710,6 +714,36 @@ private: }; #endif +class Q_GUI_EXPORT QGestureEvent : public QEvent +{ +public: + QGestureEvent(QWidget *targetWidget, const QList<QGesture*> &gestures, + const QSet<Qt::GestureType> &cancelledGestures = QSet<Qt::GestureType>()); + // internal ctor + QGestureEvent(const QGestureEvent &gestures, const QPoint &offset); + ~QGestureEvent(); + + QWidget *targetWidget() const + { return m_targetWidget; } + + inline bool contains(const Qt::GestureType &gestureType) const + { return gesture(gestureType) != 0; } + inline QList<Qt::GestureType> gestureTypes() const + { return m_gestures.keys(); } + inline const QGesture* gesture(const Qt::GestureType &gestureType) const + { return m_gestures.value(gestureType, QSharedPointer<QGesture>()).data(); } + + inline QSet<Qt::GestureType> cancelledGestures() const + { return m_cancelledGestures; } + +protected: + QWidget *m_targetWidget; + QHash<Qt::GestureType, QSharedPointer<QGesture> > m_gestures; + QSet<Qt::GestureType> m_cancelledGestures; + + friend class QApplication; +}; + #ifndef QT_NO_DEBUG_STREAM Q_GUI_EXPORT QDebug operator<<(QDebug, const QEvent *); #endif |