diff options
Diffstat (limited to 'tests/auto/widgets')
-rw-r--r-- | tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp | 70 | ||||
-rw-r--r-- | tests/auto/widgets/util/qscroller/qscroller.pro | 2 | ||||
-rw-r--r-- | tests/auto/widgets/util/qscroller/tst_qscroller.cpp | 2 |
3 files changed, 53 insertions, 21 deletions
diff --git a/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp b/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp index 2df89c076b..f98946d794 100644 --- a/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp +++ b/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp @@ -69,7 +69,37 @@ #include <windows.h> #endif +#include <QtGui/QWindowSystemInterface> + + QT_BEGIN_NAMESPACE +static QWindowSystemInterface::TouchPoint touchPoint(const QTouchEvent::TouchPoint& pt) +{ + QWindowSystemInterface::TouchPoint p; + p.id = pt.id(); + p.flags = pt.flags(); + p.normalPosition = pt.normalizedPos(); + p.area = pt.screenRect(); + p.pressure = pt.pressure(); + p.state = pt.state(); + p.velocity = pt.velocity(); + p.rawPositions = pt.rawScreenPositions(); + return p; +} + +static QList<struct QWindowSystemInterface::TouchPoint> touchPointList(const QList<QTouchEvent::TouchPoint>& pointList) +{ + QList<struct QWindowSystemInterface::TouchPoint> newList; + + Q_FOREACH (QTouchEvent::TouchPoint p, pointList) + { + newList.append(touchPoint(p)); + } + return newList; +} + + + extern bool Q_GUI_EXPORT qt_tab_all_widgets; // from qapplication.cpp QT_END_NAMESPACE @@ -1926,11 +1956,11 @@ void tst_QApplication::touchEventPropagation() QWindowSystemInterface::handleTouchEvent(window.windowHandle(), 0, device, - QTest::QTouchEventSequence::touchPointList(pressedTouchPoints)); + touchPointList(pressedTouchPoints)); QWindowSystemInterface::handleTouchEvent(window.windowHandle(), 0, device, - QTest::QTouchEventSequence::touchPointList(releasedTouchPoints)); + touchPointList(releasedTouchPoints)); QCoreApplication::processEvents(); QVERIFY(!window.seenTouchEvent); QVERIFY(window.seenMouseEvent); // Since QApplication transforms ignored touch events in mouse events @@ -1940,11 +1970,11 @@ void tst_QApplication::touchEventPropagation() QWindowSystemInterface::handleTouchEvent(window.windowHandle(), 0, device, - QTest::QTouchEventSequence::touchPointList(pressedTouchPoints)); + touchPointList(pressedTouchPoints)); QWindowSystemInterface::handleTouchEvent(window.windowHandle(), 0, device, - QTest::QTouchEventSequence::touchPointList(releasedTouchPoints)); + touchPointList(releasedTouchPoints)); QCoreApplication::processEvents(); QVERIFY(window.seenTouchEvent); QVERIFY(window.seenMouseEvent); @@ -1954,11 +1984,11 @@ void tst_QApplication::touchEventPropagation() QWindowSystemInterface::handleTouchEvent(window.windowHandle(), 0, device, - QTest::QTouchEventSequence::touchPointList(pressedTouchPoints)); + touchPointList(pressedTouchPoints)); QWindowSystemInterface::handleTouchEvent(window.windowHandle(), 0, device, - QTest::QTouchEventSequence::touchPointList(releasedTouchPoints)); + touchPointList(releasedTouchPoints)); QCoreApplication::processEvents(); QVERIFY(window.seenTouchEvent); QVERIFY(!window.seenMouseEvent); @@ -1978,11 +2008,11 @@ void tst_QApplication::touchEventPropagation() QWindowSystemInterface::handleTouchEvent(window.windowHandle(), 0, device, - QTest::QTouchEventSequence::touchPointList(pressedTouchPoints)); + touchPointList(pressedTouchPoints)); QWindowSystemInterface::handleTouchEvent(window.windowHandle(), 0, device, - QTest::QTouchEventSequence::touchPointList(releasedTouchPoints)); + touchPointList(releasedTouchPoints)); QCoreApplication::processEvents(); QVERIFY(!widget.seenTouchEvent); QVERIFY(widget.seenMouseEvent); @@ -1995,11 +2025,11 @@ void tst_QApplication::touchEventPropagation() QWindowSystemInterface::handleTouchEvent(window.windowHandle(), 0, device, - QTest::QTouchEventSequence::touchPointList(pressedTouchPoints)); + touchPointList(pressedTouchPoints)); QWindowSystemInterface::handleTouchEvent(window.windowHandle(), 0, device, - QTest::QTouchEventSequence::touchPointList(releasedTouchPoints)); + touchPointList(releasedTouchPoints)); QCoreApplication::processEvents(); QVERIFY(widget.seenTouchEvent); QVERIFY(widget.seenMouseEvent); @@ -2012,11 +2042,11 @@ void tst_QApplication::touchEventPropagation() QWindowSystemInterface::handleTouchEvent(window.windowHandle(), 0, device, - QTest::QTouchEventSequence::touchPointList(pressedTouchPoints)); + touchPointList(pressedTouchPoints)); QWindowSystemInterface::handleTouchEvent(window.windowHandle(), 0, device, - QTest::QTouchEventSequence::touchPointList(releasedTouchPoints)); + touchPointList(releasedTouchPoints)); QCoreApplication::processEvents(); QVERIFY(widget.seenTouchEvent); QVERIFY(widget.seenMouseEvent); @@ -2029,11 +2059,11 @@ void tst_QApplication::touchEventPropagation() QWindowSystemInterface::handleTouchEvent(window.windowHandle(), 0, device, - QTest::QTouchEventSequence::touchPointList(pressedTouchPoints)); + touchPointList(pressedTouchPoints)); QWindowSystemInterface::handleTouchEvent(window.windowHandle(), 0, device, - QTest::QTouchEventSequence::touchPointList(releasedTouchPoints)); + touchPointList(releasedTouchPoints)); QCoreApplication::processEvents(); QVERIFY(widget.seenTouchEvent); QVERIFY(!widget.seenMouseEvent); @@ -2047,11 +2077,11 @@ void tst_QApplication::touchEventPropagation() QWindowSystemInterface::handleTouchEvent(window.windowHandle(), 0, device, - QTest::QTouchEventSequence::touchPointList(pressedTouchPoints)); + touchPointList(pressedTouchPoints)); QWindowSystemInterface::handleTouchEvent(window.windowHandle(), 0, device, - QTest::QTouchEventSequence::touchPointList(releasedTouchPoints)); + touchPointList(releasedTouchPoints)); QCoreApplication::processEvents(); QVERIFY(!widget.seenTouchEvent); QVERIFY(widget.seenMouseEvent); @@ -2064,11 +2094,11 @@ void tst_QApplication::touchEventPropagation() QWindowSystemInterface::handleTouchEvent(window.windowHandle(), 0, device, - QTest::QTouchEventSequence::touchPointList(pressedTouchPoints)); + touchPointList(pressedTouchPoints)); QWindowSystemInterface::handleTouchEvent(window.windowHandle(), 0, device, - QTest::QTouchEventSequence::touchPointList(releasedTouchPoints)); + touchPointList(releasedTouchPoints)); QCoreApplication::processEvents(); QVERIFY(!widget.seenTouchEvent); QVERIFY(widget.seenMouseEvent); @@ -2082,11 +2112,11 @@ void tst_QApplication::touchEventPropagation() QWindowSystemInterface::handleTouchEvent(window.windowHandle(), 0, device, - QTest::QTouchEventSequence::touchPointList(pressedTouchPoints)); + touchPointList(pressedTouchPoints)); QWindowSystemInterface::handleTouchEvent(window.windowHandle(), 0, device, - QTest::QTouchEventSequence::touchPointList(releasedTouchPoints)); + touchPointList(releasedTouchPoints)); QCoreApplication::processEvents(); QVERIFY(!widget.seenTouchEvent); QVERIFY(widget.seenMouseEvent); diff --git a/tests/auto/widgets/util/qscroller/qscroller.pro b/tests/auto/widgets/util/qscroller/qscroller.pro index 9895ec661e..6f999f62c6 100644 --- a/tests/auto/widgets/util/qscroller/qscroller.pro +++ b/tests/auto/widgets/util/qscroller/qscroller.pro @@ -2,6 +2,6 @@ CONFIG += testcase CONFIG += parallel_test TARGET = tst_qscroller -QT += widgets testlib +QT += widgets testlib gui-private SOURCES += tst_qscroller.cpp DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/widgets/util/qscroller/tst_qscroller.cpp b/tests/auto/widgets/util/qscroller/tst_qscroller.cpp index 1eabbdf43f..67117eb51a 100644 --- a/tests/auto/widgets/util/qscroller/tst_qscroller.cpp +++ b/tests/auto/widgets/util/qscroller/tst_qscroller.cpp @@ -42,6 +42,8 @@ #include <QtGui> #include <QtWidgets> #include <QtTest> +#include <QtGui/QWindowSystemInterface> + // #include <QDebug> class tst_QScrollerWidget : public QWidget |