Details
-
Bug
-
Resolution: Fixed
-
P1: Critical
-
6.2.3, 6.5.1
-
None
-
-
8a934630f (dev), 06a7f7362 (6.8), 75ca1c9a5 (6.7), ac77c58da (tqtc/lts-6.5)
Description
MouseArea can emit doubleClicked() if it was clicked after another item was clicked.
QQuickDeliveryAgentPrivate::checkIfDoubleTapped(), which is called on every tap-to-mousepress, checks the new press position and the new press timestamp, to determine whether a press is a doubletap. It doesn't explicitly check if it's the same item that was pressed before, so, to prevent the current logic from wrongfully detecting doubletap, either the timestamp or the position checks must fail.
The timestamp check will pass if the system double click interval is large, and/or the click is quick (e.g. rapid tapping, or programmatically in an automated testcase). The last timestamp (touchMousePressTimestamp) can be reset, it happens sometimes, unfortunately it can be reset to 0 which is a valid timestamp. In a test case, if 0 is used as the timestamp, a-b will always be 0.
The distance test will pass if the new press is close to or identical with the old press. For this test to fail, the old press position (touchMousePressPos) could get reset when the new item is pressed. This logic is hard to follow and seems a bit unstable, but this sometimes happens. It's flaky though, since the touchMousePressPos can be reset to a new position whose distance is also within the threshold.
See attached isolated example. This error happens in our automated tests, apologies for any errors in the example itself but it's hard to fake events correctly in order to trigger the error.
Testcase explained: Two items next to eachother are clicked - left then right then left. If the right item is a RoundButton, the second click on the mouse area will be a doubleclick. If the right item is a MouseArea, it will not. The reason in this particular case is that touchMousePressPos is changed when the MouseArea is pressed, but not when the RoundButton is pressed.
Attachments
Issue Links
- resulted in
-
QTBUG-116443 Qt 6.5: missing click when single-clicking alternating items
-
- Closed
-
For Gerrit Dashboard: QTBUG-116442 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
572001,9 | QQDeliveryAgent: check every touchpoint for double-tap violations | dev | qt/qtdeclarative | Status: MERGED | +2 | 0 |
574637,2 | QQDeliveryAgent: check every touchpoint for double-tap violations | 6.8 | qt/qtdeclarative | Status: MERGED | +2 | 0 |
574715,3 | QQDeliveryAgent: check every touchpoint for double-tap violations | 6.7 | qt/qtdeclarative | Status: MERGED | +2 | 0 |
574914,4 | QQDeliveryAgent: check every touchpoint for double-tap violations | tqtc/lts-6.5 | qt/tqtc-qtdeclarative | Status: MERGED | +2 | 0 |