summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorYoann Lopes <yoann.lopes@digia.com>2014-02-06 16:53:16 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-02-14 15:02:09 +0100
commitd12e670a6f8e4d0a82b691486bd0046d8edb2c63 (patch)
treebfd3aeb3d43aefc2b29842c8bdd1a056ecf4412b /src
parent3232682d3b04ff16806fd8c5ad36271876a7b419 (diff)
iOS: correctly report Landscape or InvertedLandscape screen orientation.
The Qt documentation says that PortraitOrientation is rotated 90 degrees clockwise relative to LandscapeOrientation. This means that the home button should be on the right when held in LandscapeOrientation, therefore, Qt::LandscapeOrientation == UIDeviceOrientationLandscapeLeft. Without this patch, all QScreen mapping functions are broken. Change-Id: I2c570cd0307b7fbd59c749d6574dcb258790cfbc Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
Diffstat (limited to 'src')
-rw-r--r--src/plugins/platforms/ios/qiosglobal.mm8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/plugins/platforms/ios/qiosglobal.mm b/src/plugins/platforms/ios/qiosglobal.mm
index 8dd690f301..2ce064582e 100644
--- a/src/plugins/platforms/ios/qiosglobal.mm
+++ b/src/plugins/platforms/ios/qiosglobal.mm
@@ -86,10 +86,10 @@ Qt::ScreenOrientation toQtScreenOrientation(UIDeviceOrientation uiDeviceOrientat
qtOrientation = Qt::InvertedPortraitOrientation;
break;
case UIDeviceOrientationLandscapeLeft:
- qtOrientation = Qt::InvertedLandscapeOrientation;
+ qtOrientation = Qt::LandscapeOrientation;
break;
case UIDeviceOrientationLandscapeRight:
- qtOrientation = Qt::LandscapeOrientation;
+ qtOrientation = Qt::InvertedLandscapeOrientation;
break;
case UIDeviceOrientationFaceUp:
case UIDeviceOrientationFaceDown:
@@ -108,10 +108,10 @@ UIDeviceOrientation fromQtScreenOrientation(Qt::ScreenOrientation qtOrientation)
UIDeviceOrientation uiOrientation;
switch (qtOrientation) {
case Qt::LandscapeOrientation:
- uiOrientation = UIDeviceOrientationLandscapeRight;
+ uiOrientation = UIDeviceOrientationLandscapeLeft;
break;
case Qt::InvertedLandscapeOrientation:
- uiOrientation = UIDeviceOrientationLandscapeLeft;
+ uiOrientation = UIDeviceOrientationLandscapeRight;
break;
case Qt::InvertedPortraitOrientation:
uiOrientation = UIDeviceOrientationPortraitUpsideDown;