Make tests compile without gui-private
authorPaul Olav Tvete <paul.tvete@nokia.com>
Thu, 26 Jul 2012 16:48:56 +0000 (18:48 +0200)
committerQt by Nokia <qt-info@nokia.com>
Thu, 2 Aug 2012 15:25:37 +0000 (17:25 +0200)
Add new qt_handleXXX functions that forward to the QWindowSystemInterface
functions, and use those in the testlib inline functions. Remove use of
struct QWindowSystemInterface::TouchPoint from the testlib header files
(requiring some slight increase in ugliness in the two tests that use
that struct).

Also remove the qmake hack that adds private headers to all tests

Change-Id: Iec23537e55a44802f6e9cd463f7a0f82007c5250
Reviewed-by: Paul Olav Tvete <paul.tvete@nokia.com>
17 files changed:
src/gui/kernel/qwindowsysteminterface.cpp
src/testlib/qtestkeyboard.h
src/testlib/qtestmouse.h
src/testlib/qtesttouch.h
src/testlib/testlib.pro
tests/auto/gui/kernel/qguiapplication/qguiapplication.pro
tests/auto/gui/kernel/qguiapplication/tst_qguiapplication.cpp
tests/auto/gui/kernel/qscreen/tst_qscreen.cpp
tests/auto/gui/kernel/qtouchevent/qtouchevent.pro
tests/auto/gui/kernel/qtouchevent/tst_qtouchevent.cpp
tests/auto/gui/kernel/qwindow/tst_qwindow.cpp
tests/auto/other/gestures/gestures.pro
tests/auto/other/gestures/tst_gestures.cpp
tests/auto/other/qaccessibility/qaccessibility.pro
tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp
tests/auto/widgets/util/qscroller/qscroller.pro
tests/auto/widgets/util/qscroller/tst_qscroller.cpp

index 87aa0c6..f97dcdf 100644 (file)
@@ -617,4 +617,44 @@ void QWindowSystemInterface::handleTabletLeaveProximityEvent(int device, int poi
     handleTabletLeaveProximityEvent(time, device, pointerType, uid);
 }
 
+Q_GUI_EXPORT void qt_handleMouseEvent(QWindow *w, const QPointF & local, const QPointF & global, Qt::MouseButtons b, Qt::KeyboardModifiers mods = Qt::NoModifier) {
+    QWindowSystemInterface::handleMouseEvent(w, local, global,  b,  mods);
+}
+
+Q_GUI_EXPORT void qt_handleKeyEvent(QWindow *w, QEvent::Type t, int k, Qt::KeyboardModifiers mods, const QString & text = QString(), bool autorep = false, ushort count = 1)
+{
+    QWindowSystemInterface::handleKeyEvent(w, t, k, mods, text, autorep, count);
+}
+
+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;
+}
+
+Q_GUI_EXPORT  void qt_handleTouchEvent(QWindow *w, QTouchDevice *device,
+                                const QList<QTouchEvent::TouchPoint> &points,
+                                Qt::KeyboardModifiers mods = Qt::NoModifier)
+{
+    QWindowSystemInterface::handleTouchEvent(w, device, touchPointList(points), mods);
+}
+
 QT_END_NAMESPACE
index e694a25..c96253a 100644 (file)
@@ -56,7 +56,6 @@
 #include <QtGui/qguiapplication.h>
 #include <QtGui/qwindow.h>
 #include <QtGui/qevent.h>
-#include <QtGui/qwindowsysteminterface.h>
 
 #ifdef QT_WIDGETS_LIB
 #include <QtWidgets/qwidget.h>
@@ -67,6 +66,7 @@ QT_BEGIN_HEADER
 
 QT_BEGIN_NAMESPACE
 
+Q_GUI_EXPORT void qt_handleKeyEvent(QWindow *w, QEvent::Type t, int k, Qt::KeyboardModifiers mods, const QString & text = QString(), bool autorep = false, ushort count = 1);
 
 namespace QTest
 {
@@ -77,7 +77,7 @@ namespace QTest
     {
         QEvent::Type type;
         type = press ? QEvent::KeyPress : QEvent::KeyRelease;
-        QWindowSystemInterface::handleKeyEvent(window, type, code, modifier, text, repeat, delay);
+        qt_handleKeyEvent(window, type, code, modifier, text, repeat, delay);
 #ifdef QT_MAC_USE_COCOA
         QTest::qWait(20);
 #else
index 515c259..fa50466 100644 (file)
@@ -54,7 +54,6 @@
 #include <QtCore/qpoint.h>
 #include <QtCore/qstring.h>
 #include <QtGui/qevent.h>
-#include <QtGui/qwindowsysteminterface.h>
 
 #ifdef QT_WIDGETS_LIB
 #include <QtWidgets/qapplication.h>
@@ -65,6 +64,7 @@ QT_BEGIN_HEADER
 
 QT_BEGIN_NAMESPACE
 
+Q_GUI_EXPORT void qt_handleMouseEvent(QWindow *w, const QPointF & local, const QPointF & global, Qt::MouseButtons b, Qt::KeyboardModifiers mods = Qt::NoModifier);
 
 namespace QTest
 {
@@ -108,24 +108,24 @@ namespace QTest
         switch (action)
         {
             case MousePress:
-                QWindowSystemInterface::handleMouseEvent(window,pos,window->mapToGlobal(pos),button,stateKey);
+                qt_handleMouseEvent(window,pos,window->mapToGlobal(pos),button,stateKey);
                 lastButton = button;
                 break;
             case MouseRelease:
-                QWindowSystemInterface::handleMouseEvent(window,pos,window->mapToGlobal(pos),Qt::NoButton,stateKey);
+                qt_handleMouseEvent(window,pos,window->mapToGlobal(pos),Qt::NoButton,stateKey);
                 lastButton = Qt::NoButton;
                 break;
             case MouseDClick:
-                QWindowSystemInterface::handleMouseEvent(window,pos,window->mapToGlobal(pos),button,stateKey);
+                qt_handleMouseEvent(window,pos,window->mapToGlobal(pos),button,stateKey);
                 qWait(10);
-                QWindowSystemInterface::handleMouseEvent(window,pos,window->mapToGlobal(pos),Qt::NoButton,stateKey);
+                qt_handleMouseEvent(window,pos,window->mapToGlobal(pos),Qt::NoButton,stateKey);
                 qWait(20);
-                QWindowSystemInterface::handleMouseEvent(window,pos,window->mapToGlobal(pos),button,stateKey);
+                qt_handleMouseEvent(window,pos,window->mapToGlobal(pos),button,stateKey);
                 qWait(10);
-                QWindowSystemInterface::handleMouseEvent(window,pos,window->mapToGlobal(pos),Qt::NoButton,stateKey);
+                qt_handleMouseEvent(window,pos,window->mapToGlobal(pos),Qt::NoButton,stateKey);
                 break;
             case MouseMove:
-                QWindowSystemInterface::handleMouseEvent(window,pos,window->mapToGlobal(pos),lastButton,stateKey);
+                qt_handleMouseEvent(window,pos,window->mapToGlobal(pos),lastButton,stateKey);
                 // No QCursor::setPos() call here. That could potentially result in mouse events sent by the windowing system
                 // which is highly undesired here. Tests must avoid relying on QCursor.
                 break;
index c95d2f4..a004cce 100644 (file)
@@ -51,7 +51,6 @@
 #include <QtTest/qtestassert.h>
 #include <QtTest/qtestsystem.h>
 #include <QtTest/qtestspontaneevent.h>
-#include <QtGui/qwindowsysteminterface.h>
 #include <QtCore/qmap.h>
 #include <QtGui/qevent.h>
 #ifdef QT_WIDGETS_LIB
@@ -62,6 +61,10 @@ QT_BEGIN_HEADER
 
 QT_BEGIN_NAMESPACE
 
+Q_GUI_EXPORT  void qt_handleTouchEvent(QWindow *w, QTouchDevice *device,
+                                const QList<QTouchEvent::TouchPoint> &points,
+                                Qt::KeyboardModifiers mods = Qt::NoModifier);
+
 
 namespace QTest
 {
@@ -131,12 +134,12 @@ namespace QTest
             if (!points.isEmpty()) {
                 if (targetWindow)
                 {
-                    QWindowSystemInterface::handleTouchEvent(targetWindow, device, touchPointList(points.values()));
+                    qt_handleTouchEvent(targetWindow, device, points.values());
                 }
 #ifdef QT_WIDGETS_LIB
                 else if (targetWidget)
                 {
-                    QWindowSystemInterface::handleTouchEvent(targetWidget->windowHandle(), device, touchPointList(points.values()));
+                    qt_handleTouchEvent(targetWidget->windowHandle(), device, points.values());
                 }
 #endif
             }
@@ -146,31 +149,7 @@ namespace QTest
             points.clear();
         }
 
-        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;
-        }
-
-    private:
+private:
 #ifdef QT_WIDGETS_LIB
         QTouchEventSequence(QWidget *widget, QTouchDevice *aDevice, bool autoCommit)
             : targetWidget(widget), targetWindow(0), device(aDevice), commitWhenDestroyed(autoCommit)
index c6c3a58..5bbefb9 100644 (file)
@@ -4,7 +4,7 @@ TARGET = QtTest
 QT = core-private
 CONFIG += exceptions
 
-MODULE_CONFIG = console testlib_defines auto_use_privates
+MODULE_CONFIG = console testlib_defines
 
 unix:!embedded:QMAKE_PKGCONFIG_DESCRIPTION = Qt \
     Unit \
index e433e95..8c26529 100644 (file)
@@ -1,5 +1,5 @@
 CONFIG += testcase
 TARGET = tst_qguiapplication
-QT += core gui testlib
+QT += core gui gui-private testlib
 SOURCES = tst_qguiapplication.cpp
 DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
index 8eb0234..f7f0f8d 100644 (file)
@@ -43,6 +43,8 @@
 #include <QtTest/QtTest>
 #include <QtGui/QGuiApplication>
 #include <QtGui/QWindow>
+#include <QtGui/QWindowSystemInterface>
+
 #include <QDebug>
 
 class tst_QGuiApplication: public QObject
index e6c2886..8a0246c 100644 (file)
@@ -40,6 +40,7 @@
 ****************************************************************************/
 
 #include <qscreen.h>
+#include <QtGui/QWindowSystemInterface>
 
 #include <QtTest/QtTest>
 
index 83978cb..c6e9aa8 100644 (file)
@@ -1,4 +1,4 @@
 SOURCES=tst_qtouchevent.cpp
 TARGET=tst_qtouchevent
-QT += testlib widgets
+QT += testlib widgets gui-private
 DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
index a261d05..694a76f 100644 (file)
 #include <QtGui>
 #include <QtWidgets>
 #include <QtTest>
+#include <QtGui/QWindowSystemInterface>
+
+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;
+}
+
 
 class tst_QTouchEventWidget : public QWidget
 {
@@ -602,7 +629,7 @@ void tst_QTouchEvent::basicRawEventTranslation()
     QWindowSystemInterface::handleTouchEvent(touchWidget.windowHandle(),
                                              timestamp,
                                              touchScreenDevice,
-                                             QTest::QTouchEventSequence::touchPointList(
+                                             touchPointList(
                                                  QList<QTouchEvent::TouchPoint>() << rawTouchPoint));
     QCoreApplication::processEvents();
     QVERIFY(touchWidget.seenTouchBegin);
@@ -639,7 +666,7 @@ void tst_QTouchEvent::basicRawEventTranslation()
     QWindowSystemInterface::handleTouchEvent(touchWidget.windowHandle(),
                                              0,
                                              touchScreenDevice,
-                                             QTest::QTouchEventSequence::touchPointList(QList<QTouchEvent::TouchPoint>() << rawTouchPoint));
+                                             touchPointList(QList<QTouchEvent::TouchPoint>() << rawTouchPoint));
     QCoreApplication::processEvents();
     QVERIFY(touchWidget.seenTouchBegin);
     QVERIFY(touchWidget.seenTouchUpdate);
@@ -672,7 +699,7 @@ void tst_QTouchEvent::basicRawEventTranslation()
     QWindowSystemInterface::handleTouchEvent(touchWidget.windowHandle(),
                                              0,
                                              touchScreenDevice,
-                                             QTest::QTouchEventSequence::touchPointList(QList<QTouchEvent::TouchPoint>() << rawTouchPoint));
+                                             touchPointList(QList<QTouchEvent::TouchPoint>() << rawTouchPoint));
     QCoreApplication::processEvents();
     QVERIFY(touchWidget.seenTouchBegin);
     QVERIFY(touchWidget.seenTouchUpdate);
@@ -740,7 +767,7 @@ void tst_QTouchEvent::multiPointRawEventTranslationOnTouchScreen()
     QWindowSystemInterface::handleTouchEvent(touchWidget.windowHandle(),
                                              0,
                                              touchScreenDevice,
-                                             QTest::QTouchEventSequence::touchPointList(rawTouchPoints));
+                                             touchPointList(rawTouchPoints));
     QCoreApplication::processEvents();
     QVERIFY(!touchWidget.seenTouchBegin);
     QVERIFY(!touchWidget.seenTouchUpdate);
@@ -805,7 +832,7 @@ void tst_QTouchEvent::multiPointRawEventTranslationOnTouchScreen()
     QWindowSystemInterface::handleTouchEvent(touchWidget.windowHandle(),
                                              0,
                                              touchScreenDevice,
-                                             QTest::QTouchEventSequence::touchPointList(rawTouchPoints));
+                                             touchPointList(rawTouchPoints));
     QCoreApplication::processEvents();
     QVERIFY(!touchWidget.seenTouchBegin);
     QVERIFY(!touchWidget.seenTouchUpdate);
@@ -870,7 +897,7 @@ void tst_QTouchEvent::multiPointRawEventTranslationOnTouchScreen()
     QWindowSystemInterface::handleTouchEvent(touchWidget.windowHandle(),
                                              0,
                                              touchScreenDevice,
-                                             QTest::QTouchEventSequence::touchPointList(rawTouchPoints));
+                                             touchPointList(rawTouchPoints));
     QCoreApplication::processEvents();
     QVERIFY(!touchWidget.seenTouchBegin);
     QVERIFY(!touchWidget.seenTouchUpdate);
@@ -967,7 +994,7 @@ void tst_QTouchEvent::multiPointRawEventTranslationOnTouchPad()
     QWindowSystemInterface::handleTouchEvent(touchWidget.windowHandle(),
                                              0,
                                              touchPadDevice,
-                                             QTest::QTouchEventSequence::touchPointList(rawTouchPoints));
+                                             touchPointList(rawTouchPoints));
     QCoreApplication::processEvents();
     QVERIFY(!touchWidget.seenTouchBegin);
     QVERIFY(!touchWidget.seenTouchUpdate);
@@ -1032,7 +1059,7 @@ void tst_QTouchEvent::multiPointRawEventTranslationOnTouchPad()
     QWindowSystemInterface::handleTouchEvent(touchWidget.windowHandle(),
                                              0,
                                              touchPadDevice,
-                                             QTest::QTouchEventSequence::touchPointList(rawTouchPoints));
+                                             touchPointList(rawTouchPoints));
     QCoreApplication::processEvents();
     QVERIFY(!touchWidget.seenTouchBegin);
     QVERIFY(!touchWidget.seenTouchUpdate);
@@ -1097,7 +1124,7 @@ void tst_QTouchEvent::multiPointRawEventTranslationOnTouchPad()
     QWindowSystemInterface::handleTouchEvent(touchWidget.windowHandle(),
                                              0,
                                              touchPadDevice,
-                                             QTest::QTouchEventSequence::touchPointList(rawTouchPoints));
+                                             touchPointList(rawTouchPoints));
     QCoreApplication::processEvents();
     QVERIFY(!touchWidget.seenTouchBegin);
     QVERIFY(!touchWidget.seenTouchUpdate);
@@ -1359,7 +1386,7 @@ void tst_QTouchEvent::deleteInRawEventTranslation()
     QWindowSystemInterface::handleTouchEvent(touchWidget.windowHandle(),
                                              0,
                                              touchScreenDevice,
-                                             QTest::QTouchEventSequence::touchPointList(rawTouchPoints));
+                                             touchPointList(rawTouchPoints));
     QCoreApplication::processEvents();
     QVERIFY(pl.isNull() && !pc.isNull() && !pr.isNull());
 
@@ -1370,7 +1397,7 @@ void tst_QTouchEvent::deleteInRawEventTranslation()
     QWindowSystemInterface::handleTouchEvent(touchWidget.windowHandle(),
                                              0,
                                              touchScreenDevice,
-                                             QTest::QTouchEventSequence::touchPointList(rawTouchPoints));
+                                             touchPointList(rawTouchPoints));
     QCoreApplication::processEvents();
 
     // generate end events on all widget, the right widget should die
@@ -1380,7 +1407,7 @@ void tst_QTouchEvent::deleteInRawEventTranslation()
     QWindowSystemInterface::handleTouchEvent(touchWidget.windowHandle(),
                                              0,
                                              touchScreenDevice,
-                                             QTest::QTouchEventSequence::touchPointList(rawTouchPoints));
+                                             touchPointList(rawTouchPoints));
     QCoreApplication::processEvents();
 }
 
index f2393f9..0346284 100644 (file)
@@ -40,6 +40,7 @@
 ****************************************************************************/
 
 #include <qwindow.h>
+#include <QtGui/QWindowSystemInterface>
 
 #include <QtTest/QtTest>
 
index a4e78ef..fa87dbd 100644 (file)
@@ -1,5 +1,5 @@
 CONFIG += testcase
 TARGET = tst_gestures
-QT += widgets testlib
+QT += widgets testlib gui-private
 SOURCES  += tst_gestures.cpp
 DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
index db10877..fb27df5 100644 (file)
@@ -52,6 +52,7 @@
 #include <qgraphicswidget.h>
 #include <qgraphicsview.h>
 #include <qmainwindow.h>
+#include <QtGui/QWindowSystemInterface>
 
 #include <qdebug.h>
 
index 13c9c36..919c24d 100644 (file)
@@ -1,7 +1,7 @@
 CONFIG += testcase
 TARGET = tst_qaccessibility
 requires(contains(QT_CONFIG,accessibility))
-QT += widgets testlib
+QT += widgets testlib gui-private
 SOURCES  += tst_qaccessibility.cpp
 
 unix:!mac:LIBS+=-lm
index 2df89c0..f98946d 100644 (file)
 #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);
index 9895ec6..6f999f6 100644 (file)
@@ -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
index 1eabbdf..67117eb 100644 (file)
@@ -42,6 +42,8 @@
 #include <QtGui>
 #include <QtWidgets>
 #include <QtTest>
+#include <QtGui/QWindowSystemInterface>
+
 // #include <QDebug>
 
 class tst_QScrollerWidget : public QWidget