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>bb10
parent
3232682d3b
commit
d12e670a6f
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue