diff options
author | Bradley T. Hughes <bradley.hughes@nokia.com> | 2009-03-24 10:19:06 (GMT) |
---|---|---|
committer | Bradley T. Hughes <bradley.hughes@nokia.com> | 2009-03-24 10:26:32 (GMT) |
commit | cbac8c9c6c8bdb2868434563a20cdc16d9cc6402 (patch) | |
tree | 1a3e1a852fd1c1f8c1fa4fe4c09be3d660e4691f /src/gui/kernel/qevent.h | |
parent | 07696ec4844e6eb9b9aec58a381d9c0f9403e7c2 (diff) | |
download | Qt-cbac8c9c6c8bdb2868434563a20cdc16d9cc6402.zip Qt-cbac8c9c6c8bdb2868434563a20cdc16d9cc6402.tar.gz Qt-cbac8c9c6c8bdb2868434563a20cdc16d9cc6402.tar.bz2 |
add QTouchEvent and QGraphicsSceneTouchEvent
these events contain a list of all touch points. note that the
coordinates for QTouchEvent are floating point, since many devices
offer sub-pixel resolution.
Diffstat (limited to 'src/gui/kernel/qevent.h')
-rw-r--r-- | src/gui/kernel/qevent.h | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/src/gui/kernel/qevent.h b/src/gui/kernel/qevent.h index 449730d..3cb712d 100644 --- a/src/gui/kernel/qevent.h +++ b/src/gui/kernel/qevent.h @@ -719,6 +719,47 @@ inline bool operator==(QKeyEvent *e, QKeySequence::StandardKey key){return (e ? inline bool operator==(QKeySequence::StandardKey key, QKeyEvent *e){return (e ? e->matches(key) : false);} #endif // QT_NO_SHORTCUT +class QTouchEventTouchPointPrivate; +class Q_GUI_EXPORT QTouchEvent : public QInputEvent +{ +public: + class Q_GUI_EXPORT TouchPoint + { + public: + TouchPoint(int id = -1); + ~TouchPoint(); + + int id() const; + + Qt::TouchPointState state() const; + + const QPointF &pos() const; + const QPointF &startPos() const; + const QPointF &lastPos() const; + + const QPointF &globalPos() const; + const QPointF &startGlobalPos() const; + const QPointF &lastGlobalPos() const; + + qreal pressure() const; // 0.0 -> 1.0 + + private: + QTouchEventTouchPointPrivate *d; + + friend class QApplicationPrivate; + }; + + QTouchEvent(QEvent::Type type, + Qt::KeyboardModifiers modifiers, + const QList<TouchPoint *> &touchPoints); + + inline const QList<TouchPoint *> &touchPoints() const { return _touchPoints; + } + +protected: + QList<TouchPoint *> _touchPoints; +}; + QT_END_NAMESPACE QT_END_HEADER |