summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/ios/qiosscreen.mm
diff options
context:
space:
mode:
authorRichard Moe Gustavsen <richard.gustavsen@digia.com>2012-12-18 10:15:39 +0100
committerTor Arne Vestbø <tor.arne.vestbo@digia.com>2013-02-27 23:55:56 +0100
commit5abe9aa435c316b845f4cf5f6a930eefd449f4e1 (patch)
tree380ffd6931d8b9f1804124f606232e822f499b2b /src/plugins/platforms/ios/qiosscreen.mm
parent54448b2f9fb7501e9d4a8e2c8b75acb9de8f7ae0 (diff)
iOS: refactor general convenience functions into new file 'qiosglobal'
Some functions are needed across several files and classes. Lets place them in a common file for all to use. Change-Id: I5f9b578f948d66d10e57a835b80b5c493e07fb4c Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
Diffstat (limited to 'src/plugins/platforms/ios/qiosscreen.mm')
-rw-r--r--src/plugins/platforms/ios/qiosscreen.mm49
1 files changed, 1 insertions, 48 deletions
diff --git a/src/plugins/platforms/ios/qiosscreen.mm b/src/plugins/platforms/ios/qiosscreen.mm
index a2fd10bdd4..87ddc63f4a 100644
--- a/src/plugins/platforms/ios/qiosscreen.mm
+++ b/src/plugins/platforms/ios/qiosscreen.mm
@@ -39,6 +39,7 @@
**
****************************************************************************/
+#include "qiosglobal.h"
#include "qiosscreen.h"
#include "qioswindow.h"
#include <qpa/qwindowsysteminterface.h>
@@ -88,54 +89,6 @@
@end
-QT_BEGIN_NAMESPACE
-
-Qt::ScreenOrientation toQtScreenOrientation(UIDeviceOrientation uiDeviceOrientation)
-{
- Qt::ScreenOrientation qtOrientation;
- switch (uiDeviceOrientation) {
- case UIDeviceOrientationPortraitUpsideDown:
- qtOrientation = Qt::InvertedPortraitOrientation;
- break;
- case UIDeviceOrientationLandscapeLeft:
- qtOrientation = Qt::InvertedLandscapeOrientation;
- break;
- case UIDeviceOrientationLandscapeRight:
- qtOrientation = Qt::LandscapeOrientation;
- break;
- case UIDeviceOrientationFaceUp:
- case UIDeviceOrientationFaceDown:
- qtOrientation = static_cast<Qt::ScreenOrientation>(-1); // not supported ATM.
- break;
- default:
- qtOrientation = Qt::PortraitOrientation;
- break;
- }
- return qtOrientation;
-}
-
-UIDeviceOrientation fromQtScreenOrientation(Qt::ScreenOrientation qtOrientation)
-{
- UIDeviceOrientation uiOrientation;
- switch (qtOrientation) {
- case Qt::LandscapeOrientation:
- uiOrientation = UIDeviceOrientationLandscapeRight;
- break;
- case Qt::InvertedLandscapeOrientation:
- uiOrientation = UIDeviceOrientationLandscapeLeft;
- break;
- case Qt::InvertedPortraitOrientation:
- uiOrientation = UIDeviceOrientationPortraitUpsideDown;
- break;
- case Qt::PrimaryOrientation:
- case Qt::PortraitOrientation:
- default:
- uiOrientation = UIDeviceOrientationPortrait;
- break;
- }
- return uiOrientation;
-}
-
/*!
Returns the model identifier of the device.