diff options
author | Bradley T. Hughes <bradley.hughes@nokia.com> | 2009-06-24 10:34:31 (GMT) |
---|---|---|
committer | Bradley T. Hughes <bradley.hughes@nokia.com> | 2009-06-24 10:34:31 (GMT) |
commit | d3ce585a235e6a92b8a662c06f8686da977daa49 (patch) | |
tree | 92532e67293b2fde9ba44867ff4ffb1e966efaa3 /src/gui/kernel/qevent.h | |
parent | d8b81cad37e9477e609bbbedf0e666163bbbd813 (diff) | |
download | Qt-d3ce585a235e6a92b8a662c06f8686da977daa49.zip Qt-d3ce585a235e6a92b8a662c06f8686da977daa49.tar.gz Qt-d3ce585a235e6a92b8a662c06f8686da977daa49.tar.bz2 |
Add QTouchEvent::DeviceType and deviceType()
This enum indicates what kind of device generated the touch event
(TouchScreen or TouchPad). We use this information to control how touch
events are sent, specifically we restrict touch events to a single
widget/QGraphicsItem on touch-pads, since there is no direct
relationship between the physical touch location on the pad and the on-
using the touch-pad).
Diffstat (limited to 'src/gui/kernel/qevent.h')
-rw-r--r-- | src/gui/kernel/qevent.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/gui/kernel/qevent.h b/src/gui/kernel/qevent.h index 04303fb..146ceed 100644 --- a/src/gui/kernel/qevent.h +++ b/src/gui/kernel/qevent.h @@ -821,23 +821,32 @@ public: QTouchEventTouchPointPrivate *d; }; - QTouchEvent(QEvent::Type type, + enum DeviceType { + TouchScreen, + TouchPad + }; + + QTouchEvent(QEvent::Type eventType, + QTouchEvent::DeviceType deviceType = TouchScreen, Qt::KeyboardModifiers modifiers = Qt::NoModifier, Qt::TouchPointStates touchPointStates = 0, const QList<QTouchEvent::TouchPoint> &touchPoints = QList<QTouchEvent::TouchPoint>()); ~QTouchEvent(); inline QWidget *widget() const { return _widget; } + inline QTouchEvent::DeviceType deviceType() const { return _deviceType; } inline Qt::TouchPointStates touchPointStates() const { return _touchPointStates; } inline const QList<QTouchEvent::TouchPoint> &touchPoints() const { return _touchPoints; } // internal inline void setWidget(QWidget *widget) { _widget = widget; } + inline void setDeviceType(DeviceType deviceType) { _deviceType = deviceType; } inline void setTouchPointStates(Qt::TouchPointStates touchPointStates) { _touchPointStates = touchPointStates; } inline void setTouchPoints(const QList<QTouchEvent::TouchPoint> &touchPoints) { _touchPoints = touchPoints; } protected: QWidget *_widget; + QTouchEvent::DeviceType _deviceType; Qt::TouchPointStates _touchPointStates; QList<QTouchEvent::TouchPoint> _touchPoints; |