diff options
Diffstat (limited to 'src/plugins/platforms/android')
3 files changed, 19 insertions, 21 deletions
diff --git a/src/plugins/platforms/android/androidjniinput.cpp b/src/plugins/platforms/android/androidjniinput.cpp index 68e8da03a4..9906bdffd3 100644 --- a/src/plugins/platforms/android/androidjniinput.cpp +++ b/src/plugins/platforms/android/androidjniinput.cpp @@ -45,7 +45,6 @@ #include "qandroidplatformintegration.h" #include <qpa/qwindowsysteminterface.h> -#include <QTouchDevice> #include <QTouchEvent> #include <QPointer> @@ -276,15 +275,15 @@ namespace QtAndroidInput if (!platformIntegration) return; - QTouchDevice *touchDevice = platformIntegration->touchDevice(); + QPointingDevice *touchDevice = platformIntegration->touchDevice(); if (touchDevice == 0) { - touchDevice = new QTouchDevice; - touchDevice->setType(QTouchDevice::TouchScreen); - touchDevice->setCapabilities(QTouchDevice::Position - | QTouchDevice::Area - | QTouchDevice::Pressure - | QTouchDevice::NormalizedPosition); - QWindowSystemInterface::registerTouchDevice(touchDevice); + touchDevice = new QPointingDevice; // TODO fill out the constructor args + touchDevice->setType(QInputDevice::DeviceType::TouchScreen); + touchDevice->setCapabilities(QPointingDevice::Capability::Position + | QPointingDevice::Capability::Area + | QPointingDevice::Capability::Pressure + | QPointingDevice::Capability::NormalizedPosition); + QWindowSystemInterface::registerInputDevice(touchDevice); platformIntegration->setTouchDevice(touchDevice); } @@ -344,7 +343,7 @@ namespace QtAndroidInput #endif QWindowSystemInterface::handleTabletEvent(tlw, ulong(time), - localPos, globalPosF, QTabletEvent::Stylus, pointerType, + localPos, globalPosF, int(QInputDevice::DeviceType::Stylus), pointerType, buttons, pressure, 0, 0, 0., 0., 0, deviceId, Qt::NoModifier); #endif // QT_CONFIG(tabletevent) } diff --git a/src/plugins/platforms/android/qandroidplatformintegration.cpp b/src/plugins/platforms/android/qandroidplatformintegration.cpp index 50ab772d5a..d059096dbc 100644 --- a/src/plugins/platforms/android/qandroidplatformintegration.cpp +++ b/src/plugins/platforms/android/qandroidplatformintegration.cpp @@ -48,7 +48,6 @@ #endif #include <QOffscreenSurface> #include <QThread> -#include <QTouchDevice> #include <QtEglSupport/private/qeglpbuffer_p.h> #include <qpa/qwindowsysteminterface.h> @@ -208,12 +207,12 @@ QAndroidPlatformIntegration::QAndroidPlatformIntegration(const QStringList ¶ if (touchScreen == QJNIObjectPrivate::getStaticField<jint>("android/content/res/Configuration", "TOUCHSCREEN_FINGER") || touchScreen == QJNIObjectPrivate::getStaticField<jint>("android/content/res/Configuration", "TOUCHSCREEN_STYLUS")) { - m_touchDevice = new QTouchDevice; - m_touchDevice->setType(QTouchDevice::TouchScreen); - m_touchDevice->setCapabilities(QTouchDevice::Position - | QTouchDevice::Area - | QTouchDevice::Pressure - | QTouchDevice::NormalizedPosition); + m_touchDevice = new QPointingDevice; + m_touchDevice->setType(QInputDevice::DeviceType::TouchScreen); + m_touchDevice->setCapabilities(QPointingDevice::Capability::Position + | QPointingDevice::Capability::Area + | QPointingDevice::Capability::Pressure + | QPointingDevice::Capability::NormalizedPosition); QJNIObjectPrivate pm = javaActivity.callObjectMethod("getPackageManager", "()Landroid/content/pm/PackageManager;"); Q_ASSERT(pm.isValid()); @@ -227,7 +226,7 @@ QAndroidPlatformIntegration::QAndroidPlatformIntegration(const QStringList ¶ QJNIObjectPrivate::getStaticObjectField("android/content/pm/PackageManager", "FEATURE_TOUCHSCREEN_MULTITOUCH", "Ljava/lang/String;").object())) { m_touchDevice->setMaximumTouchPoints(2); } - QWindowSystemInterface::registerTouchDevice(m_touchDevice); + QWindowSystemInterface::registerInputDevice(m_touchDevice); } auto contentResolver = javaActivity.callObjectMethod("getContentResolver", "()Landroid/content/ContentResolver;"); diff --git a/src/plugins/platforms/android/qandroidplatformintegration.h b/src/plugins/platforms/android/qandroidplatformintegration.h index fab2083338..e6a36240d0 100644 --- a/src/plugins/platforms/android/qandroidplatformintegration.h +++ b/src/plugins/platforms/android/qandroidplatformintegration.h @@ -128,8 +128,8 @@ public: static void setScreenOrientation(Qt::ScreenOrientation currentOrientation, Qt::ScreenOrientation nativeOrientation); - QTouchDevice *touchDevice() const { return m_touchDevice; } - void setTouchDevice(QTouchDevice *touchDevice) { m_touchDevice = touchDevice; } + QPointingDevice *touchDevice() const { return m_touchDevice; } + void setTouchDevice(QPointingDevice *touchDevice) { m_touchDevice = touchDevice; } void flushPendingUpdates(); @@ -139,7 +139,7 @@ public: private: EGLDisplay m_eglDisplay; - QTouchDevice *m_touchDevice; + QPointingDevice *m_touchDevice; QAndroidPlatformScreen *m_primaryScreen; |