diff options
author | Shawn Rutledge <shawn.rutledge@theqtcompany.com> | 2016-05-02 10:46:53 +0200 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2016-06-10 13:08:00 +0000 |
commit | 04e224b19ab04ff4d5e0b3fa70c2669ab2656037 (patch) | |
tree | 552d2bfb7e92c8678fe4b0abd1cc129b2c55ba4b /src/gui/kernel | |
parent | 982b70d37db337b2c57a3cfce0f24c3d00a598d6 (diff) |
add QTest::createTouchDevice()
This enables creation of autotests which use touch events, without using
private API.
Task-number: QTBUG-44030
Change-Id: If8fe89f8423aaafd9e6501e231c33580b9365eb8
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
Diffstat (limited to 'src/gui/kernel')
-rw-r--r-- | src/gui/kernel/qwindowsysteminterface.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/gui/kernel/qwindowsysteminterface.cpp b/src/gui/kernel/qwindowsysteminterface.cpp index 60b2706d35..2cb9b8053f 100644 --- a/src/gui/kernel/qwindowsysteminterface.cpp +++ b/src/gui/kernel/qwindowsysteminterface.cpp @@ -920,6 +920,17 @@ Q_GUI_EXPORT bool qt_sendShortcutOverrideEvent(QObject *o, ulong timestamp, int #endif } +namespace QTest +{ + Q_GUI_EXPORT QTouchDevice * createTouchDevice(QTouchDevice::DeviceType devType = QTouchDevice::TouchScreen) + { + QTouchDevice *ret = new QTouchDevice(); + ret->setType(devType); + QWindowSystemInterface::registerTouchDevice(ret); + return ret; + } +} + Q_GUI_EXPORT void qt_handleTouchEvent(QWindow *w, QTouchDevice *device, const QList<QTouchEvent::TouchPoint> &points, Qt::KeyboardModifiers mods = Qt::NoModifier) |