diff options
author | Shawn Rutledge <shawn.rutledge@qt.io> | 2020-03-26 16:50:40 +0100 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2020-06-23 17:44:03 +0200 |
commit | d0ae3a312a03c118a1aa25a4c6c0352375d569fc (patch) | |
tree | 01df3e8ea22c8a1ecd969a6e9e6d7014c635da9f /src/imports/testlib | |
parent | d5d6a56809032796444fe63c220a2e940ce237c0 (diff) |
Remove QQuickPointerDevice in favor of QPointingDevice
...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 <jan-arve.saether@qt.io>
Diffstat (limited to 'src/imports/testlib')
-rw-r--r-- | src/imports/testlib/TestCase.qml | 4 | ||||
-rw-r--r-- | src/imports/testlib/quicktestevent.cpp | 11 | ||||
-rw-r--r-- | src/imports/testlib/quicktestevent_p.h | 2 |
3 files changed, 9 insertions, 8 deletions
diff --git a/src/imports/testlib/TestCase.qml b/src/imports/testlib/TestCase.qml index 380b7e38d7..7aab7ef612 100644 --- a/src/imports/testlib/TestCase.qml +++ b/src/imports/testlib/TestCase.qml @@ -1614,7 +1614,7 @@ Item { \since 5.9 - Begins a sequence of touch events through a simulated QTouchDevice::TouchScreen. + Begins a sequence of touch events through a simulated touchscreen (QPointingDevice). Events are delivered to the window containing \a item. The returned object is used to enumerate events to be delivered through a single @@ -1649,7 +1649,7 @@ Item { } \endcode - \sa TouchEventSequence::press(), TouchEventSequence::move(), TouchEventSequence::release(), TouchEventSequence::stationary(), TouchEventSequence::commit(), QTouchDevice::TouchScreen + \sa TouchEventSequence::press(), TouchEventSequence::move(), TouchEventSequence::release(), TouchEventSequence::stationary(), TouchEventSequence::commit(), QInputDevice::DeviceType::TouchScreen */ function touchEvent(item) { diff --git a/src/imports/testlib/quicktestevent.cpp b/src/imports/testlib/quicktestevent.cpp index f2d7f93d26..b2693de234 100644 --- a/src/imports/testlib/quicktestevent.cpp +++ b/src/imports/testlib/quicktestevent.cpp @@ -443,14 +443,15 @@ QObject *QQuickTouchEventSequence::commit() \internal */ -QTouchDevice *QuickTestEvent::touchDevice() +QPointingDevice *QuickTestEvent::touchDevice() { - static QTouchDevice *device(nullptr); + static QPointingDevice *device(nullptr); if (!device) { - device = new QTouchDevice; - device->setType(QTouchDevice::TouchScreen); - QWindowSystemInterface::registerTouchDevice(device); + device = new QPointingDevice(QLatin1String("test touchscreen"), 42, + QInputDevice::DeviceType::TouchScreen, QPointingDevice::PointerType::Finger, + QInputDevice::Capability::Position, 10, 0); + QWindowSystemInterface::registerInputDevice(device); } return device; } diff --git a/src/imports/testlib/quicktestevent_p.h b/src/imports/testlib/quicktestevent_p.h index 0bbae8434f..4e63a2e47e 100644 --- a/src/imports/testlib/quicktestevent_p.h +++ b/src/imports/testlib/quicktestevent_p.h @@ -122,7 +122,7 @@ public Q_SLOTS: private: QWindow *eventWindow(QObject *item = nullptr); QWindow *activeWindow(); - QTouchDevice *touchDevice(); + QPointingDevice *touchDevice(); Qt::MouseButtons m_pressedButtons; |