Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.6.2, 5.7.1, 5.8.0
-
None
-
qtbase: 8325808dcf0cc9061f05ec89b6c3e3afb8c1ab8f qtdeclarative: af002b8df9b084fd7f26e9eead9844aab36bdc4d 291223876bb190ca4b5a07cf8f605c7bf88d7ab6
Description
QGuiApplicationPrivate::processMouseEvent() (http://code.qt.io/cgit/qt/qtbase.git/tree/src/gui/kernel/qguiapplication.cpp#n1890) sets timestamp:
QMouseEvent ev(type, localPoint, localPoint, globalPoint, button, buttons, e->modifiers, e->source); ev.setTimestamp(e->timestamp);
QTest::mouseEvent does not: http://code.qt.io/cgit/qt/qtbase.git/tree/src/testlib/qtestmouse.h#n196
Neither QtQuickTest::mouseEvent do:
http://code.qt.io/cgit/qt/qtdeclarative.git/tree/src/qmltest/quicktestevent.cpp#n167
Due to this the timestamp() method of a QMouseEvent generated by a QTest::mouseClick() always returns 0.
In Qt WebEngine we use timestamp() function to recognize non-single clicks (double, triple, whatever clicks):
http://code.qt.io/cgit/qt/qtwebengine.git/tree/src/core/render_widget_host_view_qt.cpp?h=5.8#n921
Currently two subsequent mouseClick() call is detected as a double click no matter how long waiting between two clicks. Due to this we can't test/simulate clicking without workarounds (eg. https://codereview.qt-project.org/#/c/172158/).
Attachments
Issue Links
- relates to
-
QTBUG-55831 [REG: 5.5->5.6]: When doing a QTest::mouseRelease() on a window that has a Flickable in it then it will flick right to the end
-
- Closed
-
For Gerrit Dashboard: QTBUG-56223 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
172204,4 | QTestLib: Add timestamp to mouse click events | 5.8 | qt/qtbase | Status: MERGED | +2 | 0 |
172205,2 | testlib: Add timestamp to mouse click events | 5.6 | qt/qtdeclarative | Status: MERGED | +2 | 0 |
176472,2 | Remove mouse click workaround from test_navigationRequested | 5.8 | qt/qtwebengine | Status: MERGED | +2 | 0 |