diff options
author | Alexander Volkov <a.volkov@rusbitech.ru> | 2019-03-28 17:32:23 +0300 |
---|---|---|
committer | Alexander Volkov <a.volkov@rusbitech.ru> | 2019-05-01 20:29:16 +0000 |
commit | ef3daddae1720956e746142ac7ee54a27b9299d7 (patch) | |
tree | a2dfe70653fc6d4a0b55be135e57a1c42af7a948 /tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp | |
parent | 5f4b03659b1e2318acb87fd9bf7325f707dfa0ad (diff) |
Use QPlatformTheme::TouchDoubleTapDistance for touch events
... and update the cached values on theme change.
Modify tst_QWidget::touchEventSynthesizedMouseEvent()
to avoid unexpected double click detection.
Change-Id: I151c47e851ebba7550b1b09caca2781c28d7d3d9
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp')
-rw-r--r-- | tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp index 3b9c9060fa..780cb01e40 100644 --- a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp +++ b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp @@ -10152,7 +10152,8 @@ void tst_QWidget::touchEventSynthesizedMouseEvent() // We should see propagation of the TouchBegin into a MouseButtonPress TouchMouseWidget parent; TouchMouseWidget child(&parent); - child.move(5, 5); + const QPoint childPos(5, 5); + child.move(childPos); child.setAcceptMouse(false); parent.show(); QVERIFY(QTest::qWaitForWindowExposed(parent.windowHandle())); @@ -10161,13 +10162,14 @@ void tst_QWidget::touchEventSynthesizedMouseEvent() QCOMPARE(child.m_touchEventCount, 0); QCOMPARE(child.m_mouseEventCount, 0); - QTest::touchEvent(parent.window(), m_touchScreen).press(0, QPoint(10, 10), &child); + const QPoint touchPos(20, 20); + QTest::touchEvent(parent.window(), m_touchScreen).press(0, touchPos, &child); QCOMPARE(parent.m_touchEventCount, 0); QCOMPARE(parent.m_mouseEventCount, 1); - QCOMPARE(parent.m_lastMouseEventPos, QPointF(15, 15)); + QCOMPARE(parent.m_lastMouseEventPos, childPos + touchPos); QCOMPARE(child.m_touchEventCount, 0); QCOMPARE(child.m_mouseEventCount, 1); // Attempt at mouse event before propagation - QCOMPARE(child.m_lastMouseEventPos, QPointF(10, 10)); + QCOMPARE(child.m_lastMouseEventPos, touchPos); } } |