From fc567acefb9eddb4d52d7cbe6510364fa865f330 Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen Date: Tue, 14 Oct 2014 14:04:59 +0200 Subject: [PATCH] iOS: ensure edit menu works on iOS6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Method "- (id)targetForAction:(SEL)action withSender:(id)sender" is only available from iOS7. So change implementation to use whats available on iOS 6. Change-Id: I4e21495073364e83ef396dfab47a7ea2a23bbead Reviewed-by: Tor Arne Vestbø --- src/plugins/platforms/ios/quiview.mm | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/plugins/platforms/ios/quiview.mm b/src/plugins/platforms/ios/quiview.mm index 200b07b5fc..81f82ba97d 100644 --- a/src/plugins/platforms/ios/quiview.mm +++ b/src/plugins/platforms/ios/quiview.mm @@ -340,11 +340,16 @@ QWindowSystemInterface::flushWindowSystemEvents(); } -- (id)targetForAction:(SEL)action withSender:(id)sender +- (BOOL)canPerformAction:(SEL)action withSender:(id)sender { // Check first if QIOSMenu should handle the action before continuing up the responder chain - id target = [QIOSMenu::menuActionTarget() targetForAction:action withSender:sender]; - return target ? target : [super targetForAction:action withSender:sender]; + return [QIOSMenu::menuActionTarget() targetForAction:action withSender:sender] != 0; +} + +- (id)forwardingTargetForSelector:(SEL)selector +{ + Q_UNUSED(selector) + return QIOSMenu::menuActionTarget(); } @end