From 3d81b43aa462c66e11f772398550e76ce4cee6de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Thu, 8 Nov 2012 17:12:54 +0100 Subject: iOS: Implement QPlatformScreen::availableGeometry() This will sadly not work as expected until we've found a way to kick off the iOS event loop before QApplication is initialized, as UIScreen does not seem to report the correct applicationFrame (taking the status bar into account) until after the UIApplication has been set up by UIApplicationMain(). Change-Id: I0eaa3b8bca4129d1c4183a202ad2ecd0d8bc52d0 Reviewed-by: Richard Moe Gustavsen --- src/plugins/platforms/ios/qiosscreen.h | 1 + src/plugins/platforms/ios/qiosscreen.mm | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'src/plugins/platforms') diff --git a/src/plugins/platforms/ios/qiosscreen.h b/src/plugins/platforms/ios/qiosscreen.h index 8af7779f9d..8d67b1ecdf 100644 --- a/src/plugins/platforms/ios/qiosscreen.h +++ b/src/plugins/platforms/ios/qiosscreen.h @@ -56,6 +56,7 @@ public: enum ScreenIndex { MainScreen = 0 }; QRect geometry() const; + QRect availableGeometry() const; int depth() const; QImage::Format format() const; QSizeF physicalSize() const; diff --git a/src/plugins/platforms/ios/qiosscreen.mm b/src/plugins/platforms/ios/qiosscreen.mm index 93b22953e2..effd19070a 100644 --- a/src/plugins/platforms/ios/qiosscreen.mm +++ b/src/plugins/platforms/ios/qiosscreen.mm @@ -99,11 +99,15 @@ QIOSScreen::QIOSScreen(unsigned int screenIndex) QRect QIOSScreen::geometry() const { - // FIXME: Do we need to reimplement availableGeometry() to take the - // system statusbar into account? return m_geometry; } +QRect QIOSScreen::availableGeometry() const +{ + CGRect frame = m_uiScreen.applicationFrame; + return QRect(frame.origin.x, frame.origin.y, frame.size.width, frame.size.height); +} + int QIOSScreen::depth() const { return m_depth; -- cgit v1.2.3