Details
-
Technical task
-
Resolution: Unresolved
-
Not Evaluated
-
None
-
None
Description
For description and WIP patch see https://codereview.qt-project.org/#/c/208000/
Also check why some test do odd things like: http://code.qt.io/cgit/qt/qtbase.git/tree/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp#n79
static void sendMousePress(QWidget *widget, const QPoint &point, Qt::MouseButton button = Qt::LeftButton) { QMouseEvent event(QEvent::MouseButtonPress, point, widget->mapToGlobal(point), button, 0, 0); QApplication::sendEvent(widget, &event); } static void sendMouseMove(QWidget *widget, const QPoint &point, Qt::MouseButton button = Qt::NoButton, Qt::MouseButtons buttons = 0) { QTest::mouseMove(widget, point); QMouseEvent event(QEvent::MouseMove, point, button, buttons, 0); QApplication::sendEvent(widget, &event); QApplication::processEvents(); } static void sendMouseRelease(QWidget *widget, const QPoint &point, Qt::MouseButton button = Qt::LeftButton) { QMouseEvent event(QEvent::MouseButtonRelease, point, widget->mapToGlobal(point), button, 0, 0); QApplication::sendEvent(widget, &event); }
Instead of using QTest::mouse* API. Ideally we should be able to remove the following https://code.qt.io/cgit/qt/qtbase.git/tree/src/widgets/kernel/qapplication.cpp?h=5.12#n2919 from Qt source tree (which is there to support the above hack of sending mouse events directly to widgets).
Attachments
Issue Links
- relates to
-
QTBUG-38956 nextCheckState() is not triggered if QTest::mouseClick() is called
- Reported
-
QTBUG-52552 QTest::mouseClick does not trigger context menu
- Reported
-
QTBUG-60754 tst_QGraphicsScene::removeItem fails in CI due to QTest::mouseMove
- Reported
-
QTBUG-5232 When using QTest::mouseMove() it does not seem to actually receive the mouse move event on Windows and X11, whereas on Mac it works fine.
- Closed
-
QTBUG-7536 QTest::mouseClick in a QtableWidget cell does not cause a cellClicked signal.
- Closed