summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms
diff options
context:
space:
mode:
authorFilipe Azevedo <filipe.azevedo@kdab.com>2017-05-15 22:13:25 +0200
committerTor Arne Vestbø <tor.arne.vestbo@qt.io>2017-05-16 14:36:09 +0000
commitb30ce069922b57656f58c531a5bec614f00a7fda (patch)
treee0184fc00ad508cb5fd401ab550c653073908403 /src/plugins/platforms
parentd0a1135f00f21a8d1bbe21391a56fac7cb820d36 (diff)
iOS: Fix the shortcuts bar not correctly hidden
To avoid a compiler warning due to a wrong Apple api, a wrong workaround was introduced. This caused the hide of the shortcuts as expects but the visual space reserved for shortcuts was still visible as at top with a height of ~55pixels. While this is not important because the default virtual keyboard is always shown, it become a problem when one want to introduce his own virtual keyboard (UIResponder.inputView) with no shortcuts bar. This fix really hide the shortcuts bar. Task-number: QTBUG-60812 Change-Id: I0da44dfc3fda15af3351543c0a05aac973b899b9 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'src/plugins/platforms')
-rw-r--r--src/plugins/platforms/ios/qiostextresponder.mm11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/plugins/platforms/ios/qiostextresponder.mm b/src/plugins/platforms/ios/qiostextresponder.mm
index eab6792266..001985a128 100644
--- a/src/plugins/platforms/ios/qiostextresponder.mm
+++ b/src/plugins/platforms/ios/qiostextresponder.mm
@@ -242,11 +242,12 @@
if (platformData.value(kImePlatformDataHideShortcutsBar).toBool()) {
// According to the docs, leadingBarButtonGroups/trailingBarButtonGroups should be set to nil to hide the shortcuts bar.
// However, starting with iOS 10, the API has been surrounded with NS_ASSUME_NONNULL, which contradicts this and causes
- // compiler warnings. And assigning just an empty array causes layout asserts. Hence, we assign empty button groups instead.
- UIBarButtonItemGroup *leading = [[[UIBarButtonItemGroup alloc] initWithBarButtonItems:@[] representativeItem:nil] autorelease];
- UIBarButtonItemGroup *trailing = [[[UIBarButtonItemGroup alloc] initWithBarButtonItems:@[] representativeItem:nil] autorelease];
- self.inputAssistantItem.leadingBarButtonGroups = @[leading];
- self.inputAssistantItem.trailingBarButtonGroups = @[trailing];
+ // compiler warnings. Still it is the way to go to really hide the space reserved for that.
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wnonnull"
+ self.inputAssistantItem.leadingBarButtonGroups = nil;
+ self.inputAssistantItem.trailingBarButtonGroups = nil;
+#pragma clang diagnostic pop
}
}
#endif