summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@digia.com>2013-11-18 18:27:37 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-11-20 14:10:18 +0100
commitce6fd574b46cb10204f6ef598ea4377639ad1516 (patch)
treed9e9c58ea52d43b2f16679cb1abdafa3e47d7b84
parent2e2c7327dd26678d26fd7fc431a78c1d05d94411 (diff)
downloadqtbase-ce6fd574b46cb10204f6ef598ea4377639ad1516.tar.gz
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>
-rw-r--r--src/plugins/platforms/ios/qiosscreen.mm4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/plugins/platforms/ios/qiosscreen.mm b/src/plugins/platforms/ios/qiosscreen.mm
index 2d8ff7d8e1..b93511d755 100644
--- a/src/plugins/platforms/ios/qiosscreen.mm
+++ b/src/plugins/platforms/ios/qiosscreen.mm
@@ -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