summaryrefslogtreecommitdiffstats
path: root/tests/auto/widgets/util/qscroller/tst_qscroller.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/widgets/util/qscroller/tst_qscroller.cpp')
-rw-r--r--tests/auto/widgets/util/qscroller/tst_qscroller.cpp21
1 files changed, 9 insertions, 12 deletions
diff --git a/tests/auto/widgets/util/qscroller/tst_qscroller.cpp b/tests/auto/widgets/util/qscroller/tst_qscroller.cpp
index 2c398e1b2f..67bae43c9d 100644
--- a/tests/auto/widgets/util/qscroller/tst_qscroller.cpp
+++ b/tests/auto/widgets/util/qscroller/tst_qscroller.cpp
@@ -125,6 +125,9 @@ private slots:
void scrollTo();
void scroll();
void overshoot();
+
+private:
+ QTouchDevice *m_touchScreen = QTest::createTouchDevice();
};
/*! \internal
@@ -150,11 +153,8 @@ void tst_QScroller::kineticScroll( tst_QScrollerWidget *sw, QPointF from, QPoint
touchPoint.setPos(touchStart);
touchPoint.setScenePos(touchStart);
touchPoint.setScreenPos(touchStart);
- QTouchDevice *device = new QTouchDevice;
- device->setType(QTouchDevice::TouchScreen);
- QWindowSystemInterface::registerTouchDevice(device);
QTouchEvent touchEvent1(QEvent::TouchBegin,
- device,
+ m_touchScreen,
Qt::NoModifier,
Qt::TouchPointPressed,
(QList<QTouchEvent::TouchPoint>() << touchPoint));
@@ -168,7 +168,7 @@ void tst_QScroller::kineticScroll( tst_QScrollerWidget *sw, QPointF from, QPoint
touchPoint.setScenePos(touchUpdate);
touchPoint.setScreenPos(touchUpdate);
QTouchEvent touchEvent2(QEvent::TouchUpdate,
- device,
+ m_touchScreen,
Qt::NoModifier,
Qt::TouchPointMoved,
(QList<QTouchEvent::TouchPoint>() << touchPoint));
@@ -192,7 +192,7 @@ void tst_QScroller::kineticScroll( tst_QScrollerWidget *sw, QPointF from, QPoint
touchPoint.setScenePos(touchEnd);
touchPoint.setScreenPos(touchEnd);
QTouchEvent touchEvent5(QEvent::TouchEnd,
- device,
+ m_touchScreen,
Qt::NoModifier,
Qt::TouchPointReleased,
(QList<QTouchEvent::TouchPoint>() << touchPoint));
@@ -223,11 +223,8 @@ void tst_QScroller::kineticScrollNoTest( tst_QScrollerWidget *sw, QPointF from,
touchPoint.setPos(touchStart);
touchPoint.setScenePos(touchStart);
touchPoint.setScreenPos(touchStart);
- QTouchDevice *device = new QTouchDevice;
- device->setType(QTouchDevice::TouchScreen);
- QWindowSystemInterface::registerTouchDevice(device);
QTouchEvent touchEvent1(QEvent::TouchBegin,
- device,
+ m_touchScreen,
Qt::NoModifier,
Qt::TouchPointPressed,
(QList<QTouchEvent::TouchPoint>() << touchPoint));
@@ -239,7 +236,7 @@ void tst_QScroller::kineticScrollNoTest( tst_QScrollerWidget *sw, QPointF from,
touchPoint.setScenePos(touchUpdate);
touchPoint.setScreenPos(touchUpdate);
QTouchEvent touchEvent2(QEvent::TouchUpdate,
- device,
+ m_touchScreen,
Qt::NoModifier,
Qt::TouchPointMoved,
(QList<QTouchEvent::TouchPoint>() << touchPoint));
@@ -252,7 +249,7 @@ void tst_QScroller::kineticScrollNoTest( tst_QScrollerWidget *sw, QPointF from,
touchPoint.setScenePos(touchEnd);
touchPoint.setScreenPos(touchEnd);
QTouchEvent touchEvent5(QEvent::TouchEnd,
- device,
+ m_touchScreen,
Qt::NoModifier,
Qt::TouchPointReleased,
(QList<QTouchEvent::TouchPoint>() << touchPoint));