summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@digia.com>2012-11-08 17:12:54 +0100
committerTor Arne Vestbø <tor.arne.vestbo@digia.com>2013-02-27 23:55:41 +0100
commit3d81b43aa462c66e11f772398550e76ce4cee6de (patch)
tree11b0f4b5a819cea0e770ec7d0fb65210f5d77af5
parent8d7238f57e9a85524ea550917f051b9eb9927922 (diff)
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 <richard.gustavsen@digia.com>
-rw-r--r--src/plugins/platforms/ios/qiosscreen.h1
-rw-r--r--src/plugins/platforms/ios/qiosscreen.mm8
2 files changed, 7 insertions, 2 deletions
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;