From 5d878cae1d090b9c7d5730a85667e569e67c17d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Thu, 6 Dec 2012 14:13:40 +0100 Subject: iOS: Remove requestWindowOrientation from QIOSWindow The API is scheduled to be removed in qtbase in time for Qt 5.0. Change-Id: Ie34d6cb79fcd81b0ce02892529e3e7184ddfa096 Reviewed-by: Richard Moe Gustavsen --- src/plugins/platforms/ios/qiosviewcontroller.h | 7 +------ src/plugins/platforms/ios/qiosviewcontroller.mm | 22 +--------------------- src/plugins/platforms/ios/qioswindow.h | 1 - src/plugins/platforms/ios/qioswindow.mm | 16 ---------------- 4 files changed, 2 insertions(+), 44 deletions(-) diff --git a/src/plugins/platforms/ios/qiosviewcontroller.h b/src/plugins/platforms/ios/qiosviewcontroller.h index 780ec7adab..605f0f5b4c 100644 --- a/src/plugins/platforms/ios/qiosviewcontroller.h +++ b/src/plugins/platforms/ios/qiosviewcontroller.h @@ -42,11 +42,6 @@ #import #import -@interface QIOSViewController : UIViewController { -@public - bool m_shouldAutorotate; -} - --(bool)rotateToDeviceOrientation; +@interface QIOSViewController : UIViewController @end diff --git a/src/plugins/platforms/ios/qiosviewcontroller.mm b/src/plugins/platforms/ios/qiosviewcontroller.mm index 8b1a085cc5..a807dc2132 100644 --- a/src/plugins/platforms/ios/qiosviewcontroller.mm +++ b/src/plugins/platforms/ios/qiosviewcontroller.mm @@ -43,29 +43,9 @@ @implementation QIOSViewController --(id)init -{ - self = [super init]; - if (self) { - m_shouldAutorotate = NO; - } - return self; -} - --(bool)rotateToDeviceOrientation -{ - if ([UIViewController respondsToSelector:@selector(attemptRotationToDeviceOrientation)]) { - m_shouldAutorotate = YES; - [UIViewController attemptRotationToDeviceOrientation]; - m_shouldAutorotate = NO; - return true; - } - return false; -} - -(BOOL)shouldAutorotate { - return m_shouldAutorotate; + return NO; } -(NSUInteger)supportedInterfaceOrientations diff --git a/src/plugins/platforms/ios/qioswindow.h b/src/plugins/platforms/ios/qioswindow.h index e4c3a6a17c..b20c1c4fc5 100644 --- a/src/plugins/platforms/ios/qioswindow.h +++ b/src/plugins/platforms/ios/qioswindow.h @@ -87,7 +87,6 @@ public: void setWindowState(Qt::WindowState state); void handleContentOrientationChange(Qt::ScreenOrientation orientation); - Qt::ScreenOrientation requestWindowOrientation(Qt::ScreenOrientation orientation); GLuint framebufferObject(const QIOSContext &context) const; diff --git a/src/plugins/platforms/ios/qioswindow.mm b/src/plugins/platforms/ios/qioswindow.mm index 4e10c19ecc..0b2b5fcfd7 100644 --- a/src/plugins/platforms/ios/qioswindow.mm +++ b/src/plugins/platforms/ios/qioswindow.mm @@ -258,22 +258,6 @@ void QIOSWindow::handleContentOrientationChange(Qt::ScreenOrientation orientatio [[UIApplication sharedApplication] setStatusBarOrientation:uiOrientation animated:NO]; } -Qt::ScreenOrientation QIOSWindow::requestWindowOrientation(Qt::ScreenOrientation orientation) -{ - if (!m_view.window) - return Qt::PortraitOrientation; - UIViewController *viewController = m_view.window.rootViewController; - if (!viewController || [viewController isKindOfClass:[QIOSViewController class]] == false) { - return convertToQtOrientation(viewController.interfaceOrientation); - } else { - QIOSViewController *qiosViewController = static_cast(viewController); - if ([qiosViewController rotateToDeviceOrientation]) - return orientation; - else - return convertToQtOrientation(viewController.interfaceOrientation); - } -} - GLuint QIOSWindow::framebufferObject(const QIOSContext &context) const { static GLuint framebuffer = 0; -- cgit v1.2.3