diff options
Diffstat (limited to 'src/gui/kernel')
-rw-r--r-- | src/gui/kernel/qevent.cpp | 2 | ||||
-rw-r--r-- | src/gui/kernel/qevent.h | 3 | ||||
-rw-r--r-- | src/gui/kernel/qguiapplication.cpp | 5 |
3 files changed, 9 insertions, 1 deletions
diff --git a/src/gui/kernel/qevent.cpp b/src/gui/kernel/qevent.cpp index bee4c4b686..8208f6e04a 100644 --- a/src/gui/kernel/qevent.cpp +++ b/src/gui/kernel/qevent.cpp @@ -68,7 +68,7 @@ QT_BEGIN_NAMESPACE \internal */ QInputEvent::QInputEvent(Type type, Qt::KeyboardModifiers modifiers) - : QEvent(type), modState(modifiers) + : QEvent(type), modState(modifiers), ts(0) {} /*! 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 diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp index 5fc7006a74..f045861191 100644 --- a/src/gui/kernel/qguiapplication.cpp +++ b/src/gui/kernel/qguiapplication.cpp @@ -591,6 +591,7 @@ void QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::Mo if (window) { QMouseEvent ev(type, localPoint, localPoint, globalPoint, button, buttons, QGuiApplication::keyboardModifiers()); + ev.setTimestamp(e->timestamp); #ifndef QT_NO_CURSOR QList<QWeakPointer<QPlatformCursor> > cursors = QPlatformCursorPrivate::getInstances(); for (int i = 0; i < cursors.count(); ++i) @@ -618,6 +619,7 @@ void QGuiApplicationPrivate::processWheelEvent(QWindowSystemInterfacePrivate::Wh if (window) { QWheelEvent ev(e->localPos, e->globalPos, e->delta, buttons, QGuiApplication::keyboardModifiers(), e->orient); + ev.setTimestamp(e->timestamp); QGuiApplication::sendSpontaneousEvent(window, &ev); return; } @@ -638,9 +640,11 @@ void QGuiApplicationPrivate::processKeyEvent(QWindowSystemInterfacePrivate::KeyE if (e->nativeScanCode || e->nativeVirtualKey || e->nativeModifiers) { QKeyEventEx ev(e->keyType, e->key, e->modifiers, e->unicode, e->repeat, e->repeatCount, e->nativeScanCode, e->nativeVirtualKey, e->nativeModifiers); + ev.setTimestamp(e->timestamp); QGuiApplication::sendSpontaneousEvent(target, &ev); } else { QKeyEvent ev(e->keyType, e->key, e->modifiers, e->unicode, e->repeat, e->repeatCount); + ev.setTimestamp(e->timestamp); QGuiApplication::sendSpontaneousEvent(target, &ev); } } @@ -843,6 +847,7 @@ void QGuiApplicationPrivate::processTouchEvent(QWindowSystemInterfacePrivate::To QGuiApplication::keyboardModifiers(), it.value().first, it.value().second); + touchEvent.setTimestamp(e->timestamp); for (int i = 0; i < touchEvent.touchPoints().count(); ++i) { QTouchEvent::TouchPoint &touchPoint = touchEvent._touchPoints[i]; |