summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/ios
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@qt.io>2017-09-15 11:36:44 +0200
committerShawn Rutledge <shawn.rutledge@qt.io>2017-09-15 12:13:58 +0000
commitd0e93b128d17a1ee413d69e6f44e22b2c468adb7 (patch)
treed49818a23f52af8af7be2aa2d1ac96517ccc6a58 /src/plugins/platforms/ios
parent0d51767b5d20e255181bda1dd83d25c5a7777465 (diff)
iOS: disable Apple Pencil support if configure -no-feature-tabletevent
Task-number: QTBUG-59042 Change-Id: Ia60cb01206316ae85fffac44c453803f39d3a611 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Diffstat (limited to 'src/plugins/platforms/ios')
-rw-r--r--src/plugins/platforms/ios/qiosintegration.mm2
-rw-r--r--src/plugins/platforms/ios/quiview.mm14
2 files changed, 14 insertions, 2 deletions
diff --git a/src/plugins/platforms/ios/qiosintegration.mm b/src/plugins/platforms/ios/qiosintegration.mm
index 09b48a0232..3bf75d8a1f 100644
--- a/src/plugins/platforms/ios/qiosintegration.mm
+++ b/src/plugins/platforms/ios/qiosintegration.mm
@@ -123,7 +123,9 @@ QIOSIntegration::QIOSIntegration()
}
m_touchDevice->setCapabilities(touchCapabilities);
QWindowSystemInterface::registerTouchDevice(m_touchDevice);
+#if QT_CONFIG(tabletevent)
QWindowSystemInterfacePrivate::TabletEvent::setPlatformSynthesizesMouse(false);
+#endif
QMacInternalPasteboardMime::initializeMimeTypes();
for (int i = 0; i < m_optionalPlugins->metaData().size(); ++i)
diff --git a/src/plugins/platforms/ios/quiview.mm b/src/plugins/platforms/ios/quiview.mm
index 1efefd0c82..b07a24f154 100644
--- a/src/plugins/platforms/ios/quiview.mm
+++ b/src/plugins/platforms/ios/quiview.mm
@@ -318,6 +318,7 @@ Q_LOGGING_CATEGORY(lcQpaTablet, "qt.qpa.input.tablet")
QIOSIntegration *iosIntegration = QIOSIntegration::instance();
bool supportsPressure = QIOSIntegration::instance()->touchDevice()->capabilities() & QTouchDevice::Pressure;
+#if QT_CONFIG(tabletevent)
if (m_activePencilTouch && [touches containsObject:m_activePencilTouch]) {
NSArray<UITouch *> *cTouches = [event coalescedTouchesForTouch:m_activePencilTouch];
int i = 0;
@@ -347,6 +348,7 @@ Q_LOGGING_CATEGORY(lcQpaTablet, "qt.qpa.input.tablet")
++i;
}
}
+#endif
for (UITouch *uiTouch : m_activeTouches.keys()) {
QWindowSystemInterface::TouchPoint &touchPoint = m_activeTouches[uiTouch];
@@ -393,16 +395,21 @@ Q_LOGGING_CATEGORY(lcQpaTablet, "qt.qpa.input.tablet")
// points to QWindowSystemInterface::TouchPoints, and assigns each TouchPoint
// an id for use by Qt.
for (UITouch *touch in touches) {
+#if QT_CONFIG(tabletevent)
if (touch.type == UITouchTypeStylus) {
if (Q_UNLIKELY(m_activePencilTouch)) {
qWarning("ignoring additional Pencil while first is still active");
continue;
}
m_activePencilTouch = touch;
- } else {
+ } else
+ {
Q_ASSERT(!m_activeTouches.contains(touch));
+#endif
m_activeTouches[touch].id = m_nextTouchId++;
+#if QT_CONFIG(tabletevent)
}
+#endif
}
if (m_qioswindow->shouldAutoActivateWindow() && m_activeTouches.size() == 1) {
@@ -427,9 +434,12 @@ Q_LOGGING_CATEGORY(lcQpaTablet, "qt.qpa.input.tablet")
// Remove ended touch points from the active set:
for (UITouch *touch in touches) {
+#if QT_CONFIG(tabletevent)
if (touch.type == UITouchTypeStylus) {
m_activePencilTouch = nil;
- } else {
+ } else
+#endif
+ {
m_activeTouches.remove(touch);
}
}