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 <richard.gustavsen@digia.com>
bb10
Tor Arne Vestbø 2012-12-06 14:13:40 +01:00
parent ad4cf5068c
commit 5d878cae1d
4 changed files with 2 additions and 44 deletions

View File

@ -42,11 +42,6 @@
#import <UIKit/UIKit.h>
#import <QtCore/qnamespace.h>
@interface QIOSViewController : UIViewController {
@public
bool m_shouldAutorotate;
}
-(bool)rotateToDeviceOrientation;
@interface QIOSViewController : UIViewController
@end

View File

@ -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

View File

@ -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;

View File

@ -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<QIOSViewController *>(viewController);
if ([qiosViewController rotateToDeviceOrientation])
return orientation;
else
return convertToQtOrientation(viewController.interfaceOrientation);
}
}
GLuint QIOSWindow::framebufferObject(const QIOSContext &context) const
{
static GLuint framebuffer = 0;