iOS: Report native orientation of QScreen in relation to size

Instead of hard-coding it to assume the properties of the main/device
screen.

Change-Id: I94c978d4334cae5be9d1094a0c315031e54e8e1f
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
bb10
Tor Arne Vestbø 2013-11-18 18:27:37 +01:00 committed by The Qt Project
parent 2e2c7327dd
commit ce6fd574b4
1 changed files with 3 additions and 1 deletions

View File

@ -219,7 +219,9 @@ qreal QIOSScreen::devicePixelRatio() const
Qt::ScreenOrientation QIOSScreen::nativeOrientation() const
{
return Qt::PortraitOrientation;
// A UIScreen stays in the native orientation, regardless of rotation
return m_uiScreen.bounds.size.width >= m_uiScreen.bounds.size.height ?
Qt::LandscapeOrientation : Qt::PortraitOrientation;
}
Qt::ScreenOrientation QIOSScreen::orientation() const