From d0ae3a312a03c118a1aa25a4c6c0352375d569fc Mon Sep 17 00:00:00 2001 From: Shawn Rutledge Date: Thu, 26 Mar 2020 16:50:40 +0100 Subject: Remove QQuickPointerDevice in favor of QPointingDevice MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ...and generally deal with changes immediately required after adding QInputDevice and QPointingDevice. Also fixed a few usages of deprecated accessors that weren't taken care of in 212c2bffbb041aee0e3c9a7f0551ef151ed2d3ad. Task-number: QTBUG-46412 Task-number: QTBUG-69433 Task-number: QTBUG-72167 Change-Id: I93a2643162878afa216556f10808fd92e0b20071 Reviewed-by: Jan Arve Sæther --- .../qquickpinchhandler/tst_qquickpinchhandler.cpp | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) (limited to 'tests/auto/quick/pointerhandlers/qquickpinchhandler/tst_qquickpinchhandler.cpp') diff --git a/tests/auto/quick/pointerhandlers/qquickpinchhandler/tst_qquickpinchhandler.cpp b/tests/auto/quick/pointerhandlers/qquickpinchhandler/tst_qquickpinchhandler.cpp index 19fdae3b44..0c300cfd4e 100644 --- a/tests/auto/quick/pointerhandlers/qquickpinchhandler/tst_qquickpinchhandler.cpp +++ b/tests/auto/quick/pointerhandlers/qquickpinchhandler/tst_qquickpinchhandler.cpp @@ -43,9 +43,8 @@ class tst_QQuickPinchHandler: public QQmlDataTest { Q_OBJECT public: - tst_QQuickPinchHandler() : device(0) { } + tst_QQuickPinchHandler() { } private slots: - void initTestCase(); void cleanupTestCase(); void pinchProperties(); void scale(); @@ -60,17 +59,8 @@ private slots: private: QQuickView *createView(); - QTouchDevice *device; + QPointingDevice *device = QTest::createTouchDevice(); }; -void tst_QQuickPinchHandler::initTestCase() -{ - QQmlDataTest::initTestCase(); - if (!device) { - device = new QTouchDevice; - device->setType(QTouchDevice::TouchScreen); - QWindowSystemInterface::registerTouchDevice(device); - } -} void tst_QQuickPinchHandler::cleanupTestCase() { @@ -677,8 +667,7 @@ void tst_QQuickPinchHandler::cancel() QSKIP("cancel is not supported atm"); - QTouchEvent cancelEvent(QEvent::TouchCancel); - cancelEvent.setDevice(device); + QTouchEvent cancelEvent(QEvent::TouchCancel, device); QCoreApplication::sendEvent(window, &cancelEvent); QQuickTouchUtils::flush(window); -- cgit v1.2.3