summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/ios
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@digia.com>2014-07-28 14:46:18 +0200
committerJake Petroules <jake.petroules@petroules.com>2014-09-04 18:15:51 +0200
commit59385ff2ca16484d84116a91876987f503b64df2 (patch)
tree6e971eb67544795522db8e59c771eaa2caa20b64 /src/plugins/platforms/ios
parent2f0fa59d5903d4c9596ed42dcbaa9da0f77c78da (diff)
iOS: Update QIOSScreen::nativeOrientation() for iOS8
For iOS8 and up [UIScreen bounds] changes based on the interface orientation, so we need to use [UIScreen nativeBounds] instead. Change-Id: I3fc12cfa417df26ca94c803e970bc2dc18a94378 Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
Diffstat (limited to 'src/plugins/platforms/ios')
-rw-r--r--src/plugins/platforms/ios/qiosscreen.mm11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/plugins/platforms/ios/qiosscreen.mm b/src/plugins/platforms/ios/qiosscreen.mm
index a814c042c7..f1184be1b4 100644
--- a/src/plugins/platforms/ios/qiosscreen.mm
+++ b/src/plugins/platforms/ios/qiosscreen.mm
@@ -373,8 +373,15 @@ qreal QIOSScreen::devicePixelRatio() const
Qt::ScreenOrientation QIOSScreen::nativeOrientation() const
{
- // A UIScreen stays in the native orientation, regardless of rotation
- return m_uiScreen.bounds.size.width >= m_uiScreen.bounds.size.height ?
+ CGRect nativeBounds =
+#if QT_IOS_PLATFORM_SDK_EQUAL_OR_ABOVE(__IPHONE_8_0)
+ QSysInfo::MacintoshVersion >= QSysInfo::MV_IOS_8_0 ? m_uiScreen.nativeBounds :
+#endif
+ m_uiScreen.bounds;
+
+ // All known iOS devices have a native orientation of portrait, but to
+ // be on the safe side we compare the width and height of the bounds.
+ return nativeBounds.size.width >= nativeBounds.size.height ?
Qt::LandscapeOrientation : Qt::PortraitOrientation;
}