summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qevent.h
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.p.agocs@nokia.com>2011-09-05 15:56:37 +0300
committerLars Knoll <lars.knoll@nokia.com>2011-09-05 15:13:13 +0200
commit5e9f410eb67175b0f1abe95cabdb64dd30a6e7d7 (patch)
treea0b3de19307ec6d47429e611a34e993153fbdd6c /src/gui/kernel/qevent.h
parenta4e6b04419d5efa3b1165dc1e8437aac3d09fcb8 (diff)
Add timestamp to QInputEvent.
The mouse, touch, key events have no timestamp field currently, meaning that the timestamp passed to QWindowSystemInterface's handleMouse, Touch, KeyEvent functions will not be stored in the generated events. The timestamp can be quite valuable in some cases (e.g. when performing filtering of touch events) so losing this information is not desirable. The patch adds a timestamp field to QInputEvent, which is the base for mouse, touch, key, and other events, and also makes QGuiApplication to store the timestamp in the generated events. Change-Id: Icb9de8b238cb341916eac33ce21603f4955baca7 Reviewed-on: http://codereview.qt.nokia.com/4196 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Diffstat (limited to 'src/gui/kernel/qevent.h')
-rw-r--r--src/gui/kernel/qevent.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/gui/kernel/qevent.h b/src/gui/kernel/qevent.h
index 93396d860b..6f180f6365 100644
--- a/src/gui/kernel/qevent.h
+++ b/src/gui/kernel/qevent.h
@@ -77,8 +77,11 @@ public:
~QInputEvent();
inline Qt::KeyboardModifiers modifiers() const { return modState; }
inline void setModifiers(Qt::KeyboardModifiers amodifiers) { modState = amodifiers; }
+ inline ulong timestamp() const { return ts; }
+ inline void setTimestamp(ulong atimestamp) { ts = atimestamp; }
protected:
Qt::KeyboardModifiers modState;
+ ulong ts;
};
class Q_GUI_EXPORT QMouseEvent : public QInputEvent