summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/ios/qiosglobal.mm
diff options
context:
space:
mode:
authorMorten Johan Sørvig <morten.sorvig@digia.com>2013-02-14 14:08:09 +0100
committerTor Arne Vestbø <tor.arne.vestbo@digia.com>2013-02-27 23:56:09 +0100
commitc75bc5b532479e8dbe6b7f07dcc5f9fcc915f5c7 (patch)
treea3834821293196636b50fd6f8ceffd06abbe1d53 /src/plugins/platforms/ios/qiosglobal.mm
parent11d50be6dd8bbfe695408ccd011cbf63f1b4324a (diff)
iOS: Don't crash on landscape mode startup
fromPortraitToPrimary is called from the QIOSScreen constructor. This is probably to early to call QGuiApplication functions. Change-Id: I882304fd641df13dc530491990245ba9ad495377 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
Diffstat (limited to 'src/plugins/platforms/ios/qiosglobal.mm')
-rw-r--r--src/plugins/platforms/ios/qiosglobal.mm4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/plugins/platforms/ios/qiosglobal.mm b/src/plugins/platforms/ios/qiosglobal.mm
index 4657b73a10..5860078372 100644
--- a/src/plugins/platforms/ios/qiosglobal.mm
+++ b/src/plugins/platforms/ios/qiosglobal.mm
@@ -131,11 +131,11 @@ UIDeviceOrientation fromQtScreenOrientation(Qt::ScreenOrientation qtOrientation)
return uiOrientation;
}
-QRect fromPortraitToPrimary(const QRect &rect)
+QRect fromPortraitToPrimary(const QRect &rect, QPlatformScreen *screen)
{
// UIScreen is always in portrait. Use this function to convert CGRects
// aligned with UIScreen into whatever is the current orientation of QScreen.
- QRect geometry = QGuiApplication::primaryScreen()->handle()->geometry();
+ QRect geometry = screen->geometry();
return geometry.width() < geometry.height() ? rect
: QRect(rect.y(), geometry.width() - rect.width() - rect.x(), rect.height(), rect.width());
}