From cbdd73d25d4c4aa6436591b259dec10aa4f74b0d Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen Date: Tue, 18 Dec 2012 13:52:13 +0100 Subject: iOS: bugfix portraitToPrimary global function MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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ø --- src/plugins/platforms/ios/qiosglobal.mm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/plugins/platforms/ios/qiosglobal.mm') diff --git a/src/plugins/platforms/ios/qiosglobal.mm b/src/plugins/platforms/ios/qiosglobal.mm index f9b4b14a19..69547fb2a1 100644 --- a/src/plugins/platforms/ios/qiosglobal.mm +++ b/src/plugins/platforms/ios/qiosglobal.mm @@ -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 -- cgit v1.2.3