summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.p.agocs@nokia.com>2011-11-04 14:22:30 +0200
committerQt by Nokia <qt-info@nokia.com>2011-11-04 20:48:19 +0100
commit0008428f9088d1d6623dec5706d49cbf65692e28 (patch)
tree79bdc4dca5d22151baca9fd121205239e499dd61 /src
parent52df233a33e5e8486d4afd4b589e196c93ec827f (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')
-rw-r--r--src/testlib/qtesttouch.h5
-rw-r--r--src/widgets/kernel/qapplication.cpp11
-rw-r--r--src/widgets/kernel/qapplication_p.h3
-rw-r--r--src/widgets/kernel/qwidgetwindow_qpa.cpp2
4 files changed, 13 insertions, 8 deletions
diff --git a/src/testlib/qtesttouch.h b/src/testlib/qtesttouch.h
index b021934355..986d88c686 100644
--- a/src/testlib/qtesttouch.h
+++ b/src/testlib/qtesttouch.h
@@ -65,7 +65,8 @@ QT_MODULE(Test)
#ifdef QT_WIDGETS_LIB
extern Q_GUI_EXPORT void qt_translateRawTouchEvent(QWidget *window,
QTouchEvent::DeviceType deviceType,
- const QList<QTouchEvent::TouchPoint> &touchPoints);
+ const QList<QTouchEvent::TouchPoint> &touchPoints,
+ ulong timestamp);
#endif
namespace QTest
@@ -141,7 +142,7 @@ namespace QTest
#ifdef QT_WIDGETS_LIB
else if (targetWidget)
{
- qt_translateRawTouchEvent(targetWidget, deviceType, points.values());
+ qt_translateRawTouchEvent(targetWidget, deviceType, points.values(), 0);
}
#endif
}
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)