Details
-
Suggestion
-
Resolution: Done
-
P2: Important
-
5.15.2, 6.2.0
-
None
-
0f94430a0f (qt/qtbase/dev) 0f94430a0f (qt/tqtc-qtbase/dev)
Description
When using mouseDoubleClickSequence(), or simulating a double click via press-release-press-release, in a QuickTest the TapHandler does not register the double click. It emits two tapped() signals, and doubleTapped is not emitted.
I did some digging of the code to see if I could understand what was happening, and work around it.
The issue stems from the two press events being too far apart. TapHandler wants the presses to be < 0.4 seconds apart. However, the helper in QuickTest for sending mouse events explicitly stops this from happening:
case MouseRelease: me = QMouseEvent(QEvent::MouseButtonRelease, pos, window->mapToGlobal(pos), button, {}, stateKey); me.setTimestamp(++lastMouseTimestamp); lastMouseTimestamp += 500; // avoid double clicks being generated break;
qtdeclarative/src/imports/testlib/quicktestevent.cpp:199
Thus making it impossible to perform a double click action with a TapHandler.
mouseDoubleClickSequence() is a shortcut for press-release-press-doubleclick-release. Thus the timestamps would be 1; 2; 503; 504; 505.
Attachments
Issue Links
- is required for
-
QTBUG-107264 TapHandler.singleTapped is emitted immediately before we know whether a double-tap will occur
- Closed
- relates to
-
QTBUG-95421 need the ability to delay (increment timestamps of) touch events, as with mouse events
- Reported
- resulted in
-
QTBUG-77389 tst_qquicktextedit::mouseSelection has become flaky on OpenSuse
- Closed