From 575d28a6fd62c83c82de5dfc0c34013948c0c9bd Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen Date: Thu, 15 Nov 2012 13:28:59 +0100 Subject: iOS: handle content orientation feedback from application MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I2bfb4ee4840086dcd3ec85c2ee7e8769e76d2700 Reviewed-by: Tor Arne Vestbø --- src/plugins/platforms/ios/qioswindow.h | 1 + src/plugins/platforms/ios/qioswindow.mm | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/src/plugins/platforms/ios/qioswindow.h b/src/plugins/platforms/ios/qioswindow.h index 4e1970d4d4..b20c1c4fc5 100644 --- a/src/plugins/platforms/ios/qioswindow.h +++ b/src/plugins/platforms/ios/qioswindow.h @@ -86,6 +86,7 @@ public: void updateGeometry(const QRect &rect); void setWindowState(Qt::WindowState state); + void handleContentOrientationChange(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 5701ac8aa2..e220312d15 100644 --- a/src/plugins/platforms/ios/qioswindow.mm +++ b/src/plugins/platforms/ios/qioswindow.mm @@ -43,6 +43,7 @@ #include "qioscontext.h" #include "qiosscreen.h" #include "qiosapplicationdelegate.h" +#include "qiosorientationlistener.h" #import @@ -248,6 +249,14 @@ void QIOSWindow::setWindowState(Qt::WindowState state) } } +void QIOSWindow::handleContentOrientationChange(Qt::ScreenOrientation orientation) +{ + // Keep the status bar in sync with content orientation. This will ensure + // that the task bar (and associated gestures) are aligned correctly: + UIDeviceOrientation uiOrientation = convertToUIOrientation(orientation); + [[UIApplication sharedApplication] setStatusBarOrientation:uiOrientation animated:NO]; +} + GLuint QIOSWindow::framebufferObject(const QIOSContext &context) const { static GLuint framebuffer = 0; -- cgit v1.2.3