Set all timestamps for all touch events

in order for qml pointerhandlers to work correctly, they need
timestamps in all events (to decide for instance when to emit a
tapped or doubletapped)

BUG:456133
This commit is contained in:
Marco Martin 2022-07-01 12:13:18 +00:00 committed by Vlad Zahorodnii
parent 5975cd95e7
commit 56d3b2ddc4

View file

@ -384,8 +384,6 @@ bool OffscreenQuickView::forwardTouchDown(qint32 id, const QPointF &pos, quint32
bool OffscreenQuickView::forwardTouchMotion(qint32 id, const QPointF &pos, quint32 time) bool OffscreenQuickView::forwardTouchMotion(qint32 id, const QPointF &pos, quint32 time)
{ {
Q_UNUSED(time)
d->updateTouchState(Qt::TouchPointMoved, id, pos); d->updateTouchState(Qt::TouchPointMoved, id, pos);
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
@ -393,6 +391,7 @@ bool OffscreenQuickView::forwardTouchMotion(qint32 id, const QPointF &pos, quint
#else #else
QTouchEvent event(QEvent::TouchUpdate, d->touchDevice, Qt::NoModifier, d->touchPoints); QTouchEvent event(QEvent::TouchUpdate, d->touchDevice, Qt::NoModifier, d->touchPoints);
#endif #endif
event.setTimestamp(time);
QCoreApplication::sendEvent(d->m_view, &event); QCoreApplication::sendEvent(d->m_view, &event);
return event.isAccepted(); return event.isAccepted();
@ -400,8 +399,6 @@ bool OffscreenQuickView::forwardTouchMotion(qint32 id, const QPointF &pos, quint
bool OffscreenQuickView::forwardTouchUp(qint32 id, quint32 time) bool OffscreenQuickView::forwardTouchUp(qint32 id, quint32 time)
{ {
Q_UNUSED(time)
d->updateTouchState(Qt::TouchPointReleased, id, QPointF{}); d->updateTouchState(Qt::TouchPointReleased, id, QPointF{});
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
@ -409,6 +406,7 @@ bool OffscreenQuickView::forwardTouchUp(qint32 id, quint32 time)
#else #else
QTouchEvent event(QEvent::TouchEnd, d->touchDevice, Qt::NoModifier, d->touchPoints); QTouchEvent event(QEvent::TouchEnd, d->touchDevice, Qt::NoModifier, d->touchPoints);
#endif #endif
event.setTimestamp(time);
QCoreApplication::sendEvent(d->m_view, &event); QCoreApplication::sendEvent(d->m_view, &event);
return event.isAccepted(); return event.isAccepted();