diff options
author | Laszlo Agocs <laszlo.p.agocs@nokia.com> | 2011-11-04 14:22:30 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-11-04 20:48:19 +0100 |
commit | 0008428f9088d1d6623dec5706d49cbf65692e28 (patch) | |
tree | 79bdc4dca5d22151baca9fd121205239e499dd61 /src/widgets | |
parent | 52df233a33e5e8486d4afd4b589e196c93ec827f (diff) |
Prevent timestamps in widgets' touch events from disappearing
Change-Id: I096914eb2b02ad9c4a5c0462a1f4b76ef17c3957
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
Diffstat (limited to 'src/widgets')
-rw-r--r-- | src/widgets/kernel/qapplication.cpp | 11 | ||||
-rw-r--r-- | src/widgets/kernel/qapplication_p.h | 3 | ||||
-rw-r--r-- | src/widgets/kernel/qwidgetwindow_qpa.cpp | 2 |
3 files changed, 10 insertions, 6 deletions
diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp index e2a7b27430..07d2632b52 100644 --- a/src/widgets/kernel/qapplication.cpp +++ b/src/widgets/kernel/qapplication.cpp @@ -5215,7 +5215,8 @@ int QApplicationPrivate::findClosestTouchPointId(const QPointF &screenPos) void QApplicationPrivate::translateRawTouchEvent(QWidget *window, QTouchEvent::DeviceType deviceType, - const QList<QTouchEvent::TouchPoint> &touchPoints) + const QList<QTouchEvent::TouchPoint> &touchPoints, + ulong timestamp) { QApplicationPrivate *d = self; typedef QPair<Qt::TouchPointStates, QList<QTouchEvent::TouchPoint> > StatesAndTouchPoints; @@ -5352,6 +5353,7 @@ void QApplicationPrivate::translateRawTouchEvent(QWidget *window, it.value().first, it.value().second); updateTouchPointsForWidget(widget, &touchEvent); + touchEvent.setTimestamp(timestamp); switch (touchEvent.type()) { case QEvent::TouchBegin: @@ -5374,10 +5376,11 @@ void QApplicationPrivate::translateRawTouchEvent(QWidget *window, } Q_WIDGETS_EXPORT void qt_translateRawTouchEvent(QWidget *window, - QTouchEvent::DeviceType deviceType, - const QList<QTouchEvent::TouchPoint> &touchPoints) + QTouchEvent::DeviceType deviceType, + const QList<QTouchEvent::TouchPoint> &touchPoints, + ulong timestamp) { - QApplicationPrivate::translateRawTouchEvent(window, deviceType, touchPoints); + QApplicationPrivate::translateRawTouchEvent(window, deviceType, touchPoints, timestamp); } #ifndef QT_NO_GESTURES diff --git a/src/widgets/kernel/qapplication_p.h b/src/widgets/kernel/qapplication_p.h index 092eaa35a4..77a02bd5ab 100644 --- a/src/widgets/kernel/qapplication_p.h +++ b/src/widgets/kernel/qapplication_p.h @@ -499,7 +499,8 @@ public: void removeTouchPoint(int touchPointId); static void translateRawTouchEvent(QWidget *widget, QTouchEvent::DeviceType deviceType, - const QList<QTouchEvent::TouchPoint> &touchPoints); + const QList<QTouchEvent::TouchPoint> &touchPoints, + ulong timestamp); #if defined(Q_WS_WIN) static bool HasTouchSupport; diff --git a/src/widgets/kernel/qwidgetwindow_qpa.cpp b/src/widgets/kernel/qwidgetwindow_qpa.cpp index 32a446fa54..7d8b57f233 100644 --- a/src/widgets/kernel/qwidgetwindow_qpa.cpp +++ b/src/widgets/kernel/qwidgetwindow_qpa.cpp @@ -289,7 +289,7 @@ void QWidgetWindow::handleMouseEvent(QMouseEvent *event) void QWidgetWindow::handleTouchEvent(QTouchEvent *event) { - QApplicationPrivate::translateRawTouchEvent(m_widget, event->deviceType(), event->touchPoints()); + QApplicationPrivate::translateRawTouchEvent(m_widget, event->deviceType(), event->touchPoints(), event->timestamp()); } void QWidgetWindow::handleKeyEvent(QKeyEvent *event) |