summaryrefslogtreecommitdiffstats
path: root/src/testlib
diff options
context:
space:
mode:
authorVolker Krause <volker.krause@kdab.com>2015-11-17 16:16:12 +0100
committerVolker Krause <volker.krause@kdab.com>2015-11-17 15:30:40 +0000
commit874aaa6ea02d02a2eedc2b604f9b52daee630460 (patch)
tree8f608e7667981cc6712b044451da320b208d6f3d /src/testlib
parent4f1234033ba647dd4d32e87eecb832773d089abc (diff)
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 <Friedemann.Kleint@theqtcompany.com>
Diffstat (limited to 'src/testlib')
-rw-r--r--src/testlib/qtestmouse.h2
1 files changed, 1 insertions, 1 deletions
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);