summaryrefslogtreecommitdiffstats
path: root/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp')
-rw-r--r--tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp10
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 2d4d5249d2..0f9e3164c3 100644
--- a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp
+++ b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp
@@ -10153,7 +10153,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()));
@@ -10162,13 +10163,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);
}
}