diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/focus/tst_focus.cpp | 28 | ||||
-rw-r--r-- | tests/auto/qquickcontrol/tst_qquickcontrol.cpp | 15 | ||||
-rw-r--r-- | tests/auto/qquickdrawer/tst_qquickdrawer.cpp | 17 | ||||
-rw-r--r-- | tests/auto/qquickpopup/tst_qquickpopup.cpp | 13 |
4 files changed, 9 insertions, 64 deletions
diff --git a/tests/auto/focus/tst_focus.cpp b/tests/auto/focus/tst_focus.cpp index 8a1b36ad..b1b23244 100644 --- a/tests/auto/focus/tst_focus.cpp +++ b/tests/auto/focus/tst_focus.cpp @@ -43,8 +43,8 @@ #include <QtQuick/private/qquickitem_p.h> #include <QtQuickTemplates2/private/qquickcontrol_p.h> #include <QtGui/private/qguiapplication_p.h> +#include <QtGui/qpointingdevice.h> #include <QtGui/qstylehints.h> -#include <QtGui/qtouchdevice.h> #include "../shared/util.h" #include "../shared/visualtestutil.h" @@ -159,18 +159,7 @@ void tst_focus::policy() window->requestActivate(); QVERIFY(QTest::qWaitForWindowActive(window.data())); - struct TouchDeviceDeleter - { - static inline void cleanup(QTouchDevice *device) - { - QWindowSystemInterface::unregisterTouchDevice(device); - delete device; - } - }; - - QScopedPointer<QTouchDevice, TouchDeviceDeleter> device(new QTouchDevice); - device->setType(QTouchDevice::TouchScreen); - QWindowSystemInterface::registerTouchDevice(device.data()); + QScopedPointer<QPointingDevice> device(QTest::createTouchDevice()); control->setFocusPolicy(Qt::NoFocus); QCOMPARE(control->focusPolicy(), Qt::NoFocus); @@ -366,18 +355,7 @@ void tst_focus::scope() window->requestActivate(); QVERIFY(QTest::qWaitForWindowActive(window.data())); - struct TouchDeviceDeleter - { - static inline void cleanup(QTouchDevice *device) - { - QWindowSystemInterface::unregisterTouchDevice(device); - delete device; - } - }; - - QScopedPointer<QTouchDevice, TouchDeviceDeleter> device(new QTouchDevice); - device->setType(QTouchDevice::TouchScreen); - QWindowSystemInterface::registerTouchDevice(device.data()); + QScopedPointer<QPointingDevice> device(QTest::createTouchDevice()); child->forceActiveFocus(); QVERIFY(child->hasActiveFocus()); diff --git a/tests/auto/qquickcontrol/tst_qquickcontrol.cpp b/tests/auto/qquickcontrol/tst_qquickcontrol.cpp index c8d34756..6acb192f 100644 --- a/tests/auto/qquickcontrol/tst_qquickcontrol.cpp +++ b/tests/auto/qquickcontrol/tst_qquickcontrol.cpp @@ -53,16 +53,7 @@ private slots: void flickable(); private: - struct TouchDeviceDeleter - { - static inline void cleanup(QTouchDevice *device) - { - QWindowSystemInterface::unregisterTouchDevice(device); - delete device; - } - }; - - QScopedPointer<QTouchDevice, TouchDeviceDeleter> touchDevice; + QScopedPointer<QPointingDevice> touchDevice; }; @@ -71,9 +62,7 @@ void tst_QQuickControl::initTestCase() QQmlDataTest::initTestCase(); qputenv("QML_NO_TOUCH_COMPRESSION", "1"); - touchDevice.reset(new QTouchDevice); - touchDevice->setType(QTouchDevice::TouchScreen); - QWindowSystemInterface::registerTouchDevice(touchDevice.data()); + touchDevice.reset(QTest::createTouchDevice()); } void tst_QQuickControl::flickable() diff --git a/tests/auto/qquickdrawer/tst_qquickdrawer.cpp b/tests/auto/qquickdrawer/tst_qquickdrawer.cpp index 108cd4a1..c96b156c 100644 --- a/tests/auto/qquickdrawer/tst_qquickdrawer.cpp +++ b/tests/auto/qquickdrawer/tst_qquickdrawer.cpp @@ -40,8 +40,8 @@ #include "../shared/visualtestutil.h" #include "../shared/qtest_quickcontrols.h" +#include <QtGui/qpointingdevice.h> #include <QtGui/qstylehints.h> -#include <QtGui/qtouchdevice.h> #include <QtGui/qguiapplication.h> #include <QtGui/qpa/qwindowsysteminterface.h> #include <QtQuick/private/qquickwindow_p.h> @@ -112,16 +112,7 @@ private slots: void topEdgeScreenEdge(); private: - struct TouchDeviceDeleter - { - static inline void cleanup(QTouchDevice *device) - { - QWindowSystemInterface::unregisterTouchDevice(device); - delete device; - } - }; - - QScopedPointer<QTouchDevice, TouchDeviceDeleter> touchDevice; + QScopedPointer<QPointingDevice> touchDevice; }; @@ -130,9 +121,7 @@ void tst_QQuickDrawer::initTestCase() QQmlDataTest::initTestCase(); qputenv("QML_NO_TOUCH_COMPRESSION", "1"); - touchDevice.reset(new QTouchDevice); - touchDevice->setType(QTouchDevice::TouchScreen); - QWindowSystemInterface::registerTouchDevice(touchDevice.data()); + touchDevice.reset(QTest::createTouchDevice()); } void tst_QQuickDrawer::defaults() diff --git a/tests/auto/qquickpopup/tst_qquickpopup.cpp b/tests/auto/qquickpopup/tst_qquickpopup.cpp index 184d8ad8..30a21b9f 100644 --- a/tests/auto/qquickpopup/tst_qquickpopup.cpp +++ b/tests/auto/qquickpopup/tst_qquickpopup.cpp @@ -303,18 +303,7 @@ void tst_QQuickPopup::overlay() QVERIFY(popup->isVisible()); QVERIFY(overlay->isVisible()); - struct TouchDeviceDeleter - { - static inline void cleanup(QTouchDevice *device) - { - QWindowSystemInterface::unregisterTouchDevice(device); - delete device; - } - }; - - QScopedPointer<QTouchDevice, TouchDeviceDeleter> device(new QTouchDevice); - device->setType(QTouchDevice::TouchScreen); - QWindowSystemInterface::registerTouchDevice(device.data()); + QScopedPointer<QPointingDevice> device(QTest::createTouchDevice()); QTest::touchEvent(window, device.data()).press(0, QPoint(1, 1)); QCOMPARE(overlayPressedSignal.count(), ++overlayPressCount); |