From d3389a6d460a7d51a9672247366c60504f427b29 Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen Date: Tue, 6 Sep 2016 14:36:20 +0200 Subject: iOS: let quiview conform to API signature changes in iOS 10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In the iOS 10 SDK, method signatures has been annotated with NS_ASSUME_NONNULL macros and 'nullable' keywords. This means that certain methods should not be called with argumens that can be null, or in this case, set to 0 explicitly. The result will be compiler warnings. This patch will rewrite the explicit call we do to touchesCancelled so that we send an empty set instead of 0. Change-Id: I50aa80b91312397d17e0e380815adff87cee852b Reviewed-by: Tor Arne Vestbø --- src/plugins/platforms/ios/qioswindow.mm | 2 +- src/plugins/platforms/ios/quiview.mm | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'src/plugins') diff --git a/src/plugins/platforms/ios/qioswindow.mm b/src/plugins/platforms/ios/qioswindow.mm index a1576eba8e..68afed2034 100644 --- a/src/plugins/platforms/ios/qioswindow.mm +++ b/src/plugins/platforms/ios/qioswindow.mm @@ -85,7 +85,7 @@ QIOSWindow::~QIOSWindow() // practice this doesn't seem to happen when removing the view from its superview. To ensure that // Qt's internal state for touch and mouse handling is kept consistent, we therefor have to force // cancellation of all touch events. - [m_view touchesCancelled:0 withEvent:0]; + [m_view touchesCancelled:[NSSet set] withEvent:0]; clearAccessibleCache(); m_view->m_qioswindow = 0; diff --git a/src/plugins/platforms/ios/quiview.mm b/src/plugins/platforms/ios/quiview.mm index 4dd43be465..dce3098846 100644 --- a/src/plugins/platforms/ios/quiview.mm +++ b/src/plugins/platforms/ios/quiview.mm @@ -417,7 +417,8 @@ // We do this by assuming that there are no cases where a // sub-set of the active touch events are intentionally cancelled. - if (touches && (static_cast([touches count]) != m_activeTouches.count())) + NSInteger count = static_cast([touches count]); + if (count != 0 && count != m_activeTouches.count()) qWarning("Subset of active touches cancelled by UIKit"); m_activeTouches.clear(); -- cgit v1.2.3