iOS: handle content orientation feedback from application

Change-Id: I2bfb4ee4840086dcd3ec85c2ee7e8769e76d2700
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
bb10
Richard Moe Gustavsen 2012-11-15 13:28:59 +01:00 committed by Tor Arne Vestbø
parent fa731cddd1
commit 575d28a6fd
2 changed files with 10 additions and 0 deletions

View File

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

View File

@ -43,6 +43,7 @@
#include "qioscontext.h"
#include "qiosscreen.h"
#include "qiosapplicationdelegate.h"
#include "qiosorientationlistener.h"
#import <QuartzCore/CAEAGLLayer.h>
@ -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;