path: root/src/plugins/platforms/ios/qiosviewcontroller.h
diff options
authorRichard Moe Gustavsen <>2012-11-16 11:14:34 +0100
committerTor Arne Vestbø <>2013-02-27 23:55:46 +0100
commit55f0bce0945a2f2b28e2454fbc03b1efd61819e4 (patch)
treece656094925614213017de2051505404fb3ac455 /src/plugins/platforms/ios/qiosviewcontroller.h
parent575d28a6fd62c83c82de5dfc0c34013948c0c9bd (diff)
iOS: implement requestWindowOrientation
The application is normally supposed to rotate the content on its own, but can call requestWindowOrientation to ask the window manager to do it instead. This way of integrating orientation with the OS is fragile, because: 1. In some cases, you cannot stop the OS from rotating at all (tablets). 2. It would be more safe to inform the window manager up-front which orientations it could rotate into, rather that relying on a function you call call to force this later on. 3. When the QML application starts, its a bit late to inform the platform plugin that it supports e.g landscape. If the OS is in landscape already, the plugin must still assume that the app operates in portrait (doing rotating on its own) until requestWindowOrientation is called. This might cause the app to first start up in portrait, just to rotate into landscape. On iOS, it seems like we can handle the first two cases. The third need some more investigation. We should anyway investigate if we need some adjustment to the Qt API. Change-Id: I50638b78d469ab70820a787de86a2f1981470786 Reviewed-by: Tor Arne Vestbø <>
Diffstat (limited to 'src/plugins/platforms/ios/qiosviewcontroller.h')
1 files changed, 7 insertions, 1 deletions
diff --git a/src/plugins/platforms/ios/qiosviewcontroller.h b/src/plugins/platforms/ios/qiosviewcontroller.h
index d5a61cb3f4..780ec7adab 100644
--- a/src/plugins/platforms/ios/qiosviewcontroller.h
+++ b/src/plugins/platforms/ios/qiosviewcontroller.h
@@ -40,7 +40,13 @@
#import <UIKit/UIKit.h>
+#import <QtCore/qnamespace.h>
-@interface QIOSViewController : UIViewController
+@interface QIOSViewController : UIViewController {
+ bool m_shouldAutorotate;