Details
-
Bug
-
Resolution: Done
-
P2: Important
-
6.0, 6.1, 6.2, 6.3
-
-
3c3aef1486 (qt/qtdeclarative/dev) b7a6d06705 (qt/qtdeclarative/6.4) b7a6d06705 (qt/tqtc-qtdeclarative/6.4) 4049293182 (qt/qtdeclarative/6.3) 4049293182 (qt/tqtc-qtdeclarative/6.3)
Description
Use the time stamp of the touch event when converting a touch event to a mouse event for items that do not handle touch events (such as PathView etc)
diff --git a/src/quick/util/qquickdeliveryagent.cpp b/src/quick/util/qquickdeliveryagent.cpp index 44255a74f8..fdafff0901 100644 --- a/src/quick/util/qquickdeliveryagent.cpp +++ b/src/quick/util/qquickdeliveryagent.cpp @@ -81,6 +81,7 @@ void QQuickDeliveryAgentPrivate::touchToMouseEvent(QEvent::Type type, const QEve (type == QEvent::MouseButtonRelease ? Qt::NoButton : Qt::LeftButton), touchEvent->modifiers(), Qt::MouseEventSynthesizedByQt); ret.setAccepted(true); // this now causes the persistent touchpoint to be accepted too + ret.setTimestamp(touchEvent->timestamp()); *mouseEvent = ret; }
A series of touch events in a very short period of time may be ignored or the accuracy of velocity calculation may be reduced without above fix.
For example, because of the code below.
qint64 QQuickPathViewPrivate::computeCurrentTime(QInputEvent *event) const { if (0 != event->timestamp()) { return qint64(event->timestamp()); } return timer.elapsed(); } void QQuickPathViewPrivate::handleMouseMoveEvent(QMouseEvent *event) { qint64 currentTimestamp = computeCurrentTime(event); .......... qint64 elapsed = currentTimestamp - lastPosTime; if (elapsed > 0) addVelocitySample(diff / (qreal(elapsed) / 1000)); .......... }
Attachments
For Gerrit Dashboard: QTBUG-105907 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
428517,7 | Use the time stamp of the touch event when deliver touch as mouse | dev | qt/qtdeclarative | Status: MERGED | +2 | 0 |
429021,2 | Use the time stamp of the touch event when deliver touch as mouse | 6.4 | qt/qtdeclarative | Status: MERGED | +2 | 0 |
429022,2 | Use the time stamp of the touch event when deliver touch as mouse | 6.3 | qt/qtdeclarative | Status: MERGED | +2 | 0 |
429023,2 | Use the time stamp of the touch event when deliver touch as mouse | tqtc/lts-6.2 | qt/tqtc-qtdeclarative | Status: MERGED | +2 | 0 |