From f6c36917f15fda0066bf996c1d36ef6dace9f404 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Mon, 28 Jul 2014 14:46:18 +0200 Subject: iOS: Update QIOSScreen::nativeOrientation() for iOS8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Richard Moe Gustavsen --- src/plugins/platforms/ios/qiosscreen.mm | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/plugins/platforms/ios/qiosscreen.mm b/src/plugins/platforms/ios/qiosscreen.mm index 5331d05ae9..bb51d79e2a 100644 --- a/src/plugins/platforms/ios/qiosscreen.mm +++ b/src/plugins/platforms/ios/qiosscreen.mm @@ -294,8 +294,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; } -- cgit v1.2.3