From 874aaa6ea02d02a2eedc2b604f9b52daee630460 Mon Sep 17 00:00:00 2001 From: Volker Krause Date: Tue, 17 Nov 2015 16:16:12 +0100 Subject: QTest::mouseEvent expects window-local coordinates. This makes the automatic center click feature of the mouse event methods also work if the target window isn't positioned at 0,0. Change-Id: I0d711e484620900ba2ffc4139f7e13346a7482d3 Reviewed-by: Friedemann Kleint --- src/testlib/qtestmouse.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/testlib/qtestmouse.h b/src/testlib/qtestmouse.h index c422a990ef..c5969a1603 100644 --- a/src/testlib/qtestmouse.h +++ b/src/testlib/qtestmouse.h @@ -95,7 +95,7 @@ namespace QTest } if (pos.isNull()) - pos = window->geometry().center(); + pos = QPoint(window->width() / 2, window->height() / 2); QTEST_ASSERT(uint(stateKey) == 0 || stateKey & Qt::KeyboardModifierMask); -- cgit v1.2.3