summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorMorten Johan Sørvig <morten.sorvig@theqtcompany.com>2015-06-02 17:04:05 +0200
committerMorten Johan Sørvig <morten.sorvig@theqtcompany.com>2015-06-09 15:21:09 +0000
commit34e06b48678b60716d614281898fd4e18fb4d586 (patch)
tree1dfefad635e0fcfa21b7b13e2e4d3cc52629ad38 /tests/auto
parent5964294506514f06cc6b5355b5c575a956d60a38 (diff)
Make testInputEvents not use QWindowSystemInterface
Use QTestLib instead, which will handle the QHighDpi coordinate scaling. Change-Id: Ib2ab9c6edfa6ffbf594ab6251c4b0b83f9581d6c Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/gui/kernel/qwindow/tst_qwindow.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp b/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp
index 0189d99227..41c129ad9b 100644
--- a/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp
+++ b/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp
@@ -662,16 +662,13 @@ void tst_QWindow::testInputEvents()
window.showNormal();
QVERIFY(QTest::qWaitForWindowExposed(&window));
- QWindowSystemInterface::handleKeyEvent(&window, QEvent::KeyPress, Qt::Key_A, Qt::NoModifier);
- QWindowSystemInterface::handleKeyEvent(&window, QEvent::KeyRelease, Qt::Key_A, Qt::NoModifier);
+ QTest::keyClick(&window, Qt::Key_A, Qt::NoModifier);
QCoreApplication::processEvents();
QCOMPARE(window.keyPressCode, int(Qt::Key_A));
QCOMPARE(window.keyReleaseCode, int(Qt::Key_A));
QPointF local(12, 34);
- const QPointF deviceLocal = QHighDpi::toNativeLocalPosition(local, &window);
- QWindowSystemInterface::handleMouseEvent(&window, deviceLocal, deviceLocal, Qt::LeftButton);
- QWindowSystemInterface::handleMouseEvent(&window, deviceLocal, deviceLocal, Qt::NoButton);
+ QTest::mouseClick(&window, Qt::LeftButton, Qt::NoModifier, local.toPoint());
QCoreApplication::processEvents();
QCOMPARE(window.mousePressButton, int(Qt::LeftButton));
QCOMPARE(window.mouseReleaseButton, int(Qt::LeftButton));