From fcc5323a08f955bcedd8a8a9750173384fa7d71f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= Date: Fri, 7 Jun 2019 16:04:23 +0200 Subject: Make test less dependent on moving the cursor The sendMouseMove() function calls QTest::mouseMove(), which again calls QCursor::setPos() to move the cursor. It then creates and sends a MouseMove event, using the constructor which picks up the global position by calling QCursor::pos(). On macOS 10.14, QCursor::setPos() may silently fail if the user does not grant the application permission to move the cursor (via a dialog). As result of this the mouse move event gets an incorrect global position. Provide the global position directly when creating the event to make sure it gets the correct value. Task-number: QTBUG-75786 Change-Id: I3e8df450fea802783a3d1dbe471753f502b42de3 Reviewed-by: Richard Moe Gustavsen --- tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/auto/widgets/graphicsview/qgraphicsview') diff --git a/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp b/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp index 28df3a3c38..1456b9e35c 100644 --- a/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp +++ b/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp @@ -88,7 +88,7 @@ static void sendMousePress(QWidget *widget, const QPoint &point, Qt::MouseButton 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); + QMouseEvent event(QEvent::MouseMove, point, widget->mapToGlobal(point), button, buttons, 0); QApplication::sendEvent(widget, &event); QApplication::processEvents(); } -- cgit v1.2.3 From 662fec6f0db32fb58b91357aa11c9d3be94f0c55 Mon Sep 17 00:00:00 2001 From: Daniel Smith Date: Fri, 9 Aug 2019 11:04:27 +0200 Subject: Update for failures only on dev branch. Use general platform names This patch was generated with tooling from patchset 31 of https://codereview.qt-project.org/c/qt/qtqa/+/267034 in interactive mode. General platform names were chosen if greater than 60% of the currently active platforms of a given type in COIN recently failed. Change-Id: Ia4bde7f0ec422bbb727dc9d7151295159094f146 Reviewed-by: Eskil Abrahamsen Blomfeldt --- tests/auto/widgets/graphicsview/qgraphicsview/BLACKLIST | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'tests/auto/widgets/graphicsview/qgraphicsview') diff --git a/tests/auto/widgets/graphicsview/qgraphicsview/BLACKLIST b/tests/auto/widgets/graphicsview/qgraphicsview/BLACKLIST index 22fce8620b..9b76ea02ff 100644 --- a/tests/auto/widgets/graphicsview/qgraphicsview/BLACKLIST +++ b/tests/auto/widgets/graphicsview/qgraphicsview/BLACKLIST @@ -1,24 +1,16 @@ [task255529_transformationAnchorMouseAndViewportMargins] opensuse-leap -rhel-7.4 -ubuntu-16.04 -opensuse-42.3 [cursor] opensuse-leap -ubuntu-16.04 -opensuse-42.3 [cursor2] ubuntu-16.04 [sendEvent] ubuntu-16.04 opensuse-42.3 [resizeAnchor] -ubuntu-16.04 -rhel-7.6 opensuse-leap -ubuntu-18.04 -rhel-7.4 -opensuse-42.3 +rhel-7.6 +ubuntu [update2] opensuse-42.3 [itemsInRect_cosmeticAdjust] -- cgit v1.2.3