iOS: bugfix portraitToPrimary global function

QScreen geometry and orientation is updated a bit after we
change geometry in QPlatformScreen, which this time was enough to
break availableGeometry. Since this function is for internal use, we
let it be based on internal data.

Change-Id: I7701b0a6043839c89c01e87242decb8a739d00f1
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
bb10
Richard Moe Gustavsen 2012-12-18 13:52:13 +01:00 committed by Tor Arne Vestbø
parent 5b452a5022
commit cbdd73d25d
1 changed files with 3 additions and 3 deletions

View File

@ -117,9 +117,9 @@ QRect fromPortraitToPrimary(const QRect &rect)
{
// UIScreen is always in portrait. Use this function to convert CGRects
// aligned with UIScreen into whatever is the current orientation of QScreen.
QScreen *screen = QGuiApplication::primaryScreen();
return screen->isPortrait(screen->primaryOrientation()) ? rect
: QRect(rect.y(), screen->geometry().width() - rect.width() - rect.x(), rect.height(), rect.width());
QRect geometry = QGuiApplication::primaryScreen()->handle()->geometry();
return geometry.width() < geometry.height() ? rect
: QRect(rect.y(), geometry.width() - rect.width() - rect.x(), rect.height(), rect.width());
}
QT_END_NAMESPACE