path: root/src/plugins/platforms
diff options
authorTor Arne Vestbø <>2012-12-10 19:27:30 +0100
committerTor Arne Vestbø <>2013-02-27 23:55:51 +0100
commit31a76b978b3f1c08787e3f88987e3a396d5eec45 (patch)
treefd252a426e595a086fc411277ac829fec14d76d2 /src/plugins/platforms
parent21965187096f8bde7866b05459444793e1a6c1b1 (diff)
iOS: Enable auto-rotation if no orientation update-mask has been set
This is an intermediate heuristic until we have a proper API in Qt to deal with auto-rotation and orientation locking. Change-Id: I433992fa1c18d1670987f79e405a4501b6e5d365 Reviewed-by: Richard Moe Gustavsen <>
Diffstat (limited to 'src/plugins/platforms')
1 files changed, 11 insertions, 2 deletions
diff --git a/src/plugins/platforms/ios/ b/src/plugins/platforms/ios/
index a807dc2132..3121597dba 100644
--- a/src/plugins/platforms/ios/
+++ b/src/plugins/platforms/ios/
@@ -41,18 +41,27 @@
#import "qiosviewcontroller.h"
+#include <QtGui/QGuiApplication>
+#include <QtGui/QScreen>
@implementation QIOSViewController
- return NO;
+ // For now we assume that if the application doesn't listen to orientation
+ // updates it means it would like to enable auto-rotation, and vice versa.
+ if (QGuiApplication *guiApp = qobject_cast<QGuiApplication *>(qApp))
+ return !guiApp->primaryScreen()->orientationUpdateMask();
+ else
+ return NO;
+ // FIXME: Investigate a proper Qt API for auto-rotation and orientation locking
// We need to tell iOS that we support all orientations in order to set
// status bar orientation when application content orientation changes.
- // But we return 'NO' above when asked if we 'shouldAutorotate':
return UIInterfaceOrientationMaskAll;