summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/ios/quiview.mm
diff options
context:
space:
mode:
authorMike Krus <mike.krus@kdab.com>2016-02-16 14:29:59 +0000
committerJake Petroules <jake.petroules@qt.io>2016-05-17 16:11:23 +0000
commit03e9c6f4a62582837fc9f5961ecbccd0a3d1b5d6 (patch)
treec52961c92f5968a7355941fa224dfc74268ce150 /src/plugins/platforms/ios/quiview.mm
parent26d44fce3dfb9dbd3b5be2a031fff8c1bb903960 (diff)
Add support for Apple tvOS
Pass -xplatform macx-tvos-clang to configure to build. Builds device and simulator by default. Added ‘uikit’ platform with the common setup. Also added QT_PLATFORM_UIKIT define (undocumented). qmake config defines tvos (but not ios). tvOS is 64bits only (QT_ARCH is arm64) and requires bitcode to be embedded in the binary. A new ‘bitcode’ configuration was added. For ReleaseDevice builds (which get archived and push to the store), bitcode is actually embedded (-fembed-bitcode passed to clang). For all other configurations, only using bitcode markers to keep file size down (-fembed-bitcode-marker). Build disables Widgets in qtbase, and qtscript (unsupported, would require fixes to JavaScriptCore source code). Qpa same as on iOS but disables device orientation, status bar, clipboard, menus, dialogs which are not supported on tvOS. Change-Id: I645804fd933be0befddeeb43095a74d2c178b2ba Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
Diffstat (limited to 'src/plugins/platforms/ios/quiview.mm')
-rw-r--r--src/plugins/platforms/ios/quiview.mm15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/plugins/platforms/ios/quiview.mm b/src/plugins/platforms/ios/quiview.mm
index e38be68343..b199f28149 100644
--- a/src/plugins/platforms/ios/quiview.mm
+++ b/src/plugins/platforms/ios/quiview.mm
@@ -44,7 +44,9 @@
#include "qiosviewcontroller.h"
#include "qiostextresponder.h"
#include "qioswindow.h"
+#ifndef Q_OS_TVOS
#include "qiosmenu.h"
+#endif
#include <QtGui/private/qguiapplication_p.h>
#include <QtGui/private/qwindow_p.h>
@@ -78,7 +80,9 @@
if (isQtApplication())
self.hidden = YES;
+#ifndef Q_OS_TVOS
self.multipleTouchEnabled = YES;
+#endif
if (QIOSIntegration::instance()->debugWindowManagement()) {
static CGFloat hue = 0.0;
@@ -324,6 +328,7 @@
// Touch positions are expected to be in QScreen global coordinates, and
// as we already have the QWindow positioned at the right place, we can
// just map from the local view position to global coordinates.
+ // tvOS: all touches start at the center of the screen and move from there.
QPoint localViewPosition = fromCGPoint([uiTouch locationInView:self]).toPoint();
QPoint globalScreenPosition = m_qioswindow->mapToGlobal(localViewPosition);
@@ -439,14 +444,24 @@
- (BOOL)canPerformAction:(SEL)action withSender:(id)sender
{
+#ifndef Q_OS_TVOS
// Check first if QIOSMenu should handle the action before continuing up the responder chain
return [QIOSMenu::menuActionTarget() targetForAction:action withSender:sender] != 0;
+#else
+ Q_UNUSED(action)
+ Q_UNUSED(sender)
+ return false;
+#endif
}
- (id)forwardingTargetForSelector:(SEL)selector
{
Q_UNUSED(selector)
+#ifndef Q_OS_TVOS
return QIOSMenu::menuActionTarget();
+#else
+ return nil;
+#endif
}
@end