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>
This commit is contained in:
Tor Arne Vestbø 2012-11-08 17:12:54 +01:00
parent 8d7238f57e
commit 3d81b43aa4
2 changed files with 7 additions and 2 deletions

View File

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

View File

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