summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Wildemann <metalstrolch@users.noreply.github.com>2017-06-05 05:26:48 +0200
committerPierre GRANDIN <pgrandin@users.noreply.github.com>2017-06-04 20:26:48 -0700
commit58ac737ffea75559a9d4a6d9b1e6965a8770c593 (patch)
treea9f0c99d2bc024cd89be7f84b04349e1945bd8bf
parent825a26d1a3740a7d160bda468fd0a21dcd3d32b7 (diff)
downloadnavit-58ac737ffea75559a9d4a6d9b1e6965a8770c593.tar.gz
Fix: Make rotating compatible to Qt 5.2 (#256)R7604
Welcome to Qt5 compatibility hell. Seems like the Screen.orientationUpdateMask property is only valid from Qt5.4 and beyond. To make this compatible down to Qt5.2, i introduce a QML JavaScript workaround/hack.
-rw-r--r--navit/graphics/qt5/loader.qml9
1 files changed, 7 insertions, 2 deletions
diff --git a/navit/graphics/qt5/loader.qml b/navit/graphics/qt5/loader.qml
index ed9425bf7..9882cb23a 100644
--- a/navit/graphics/qt5/loader.qml
+++ b/navit/graphics/qt5/loader.qml
@@ -5,8 +5,6 @@ import QtQuick.Window 2.0
Window {
width: 200; height: 200
- Screen.orientationUpdateMask: Qt.PortraitOrientation + Qt.LandscapeOrientation + Qt.InvertedPortraitOrientation + Qt.InvertedLandscapeOrientation
-
Item {
id: root
anchors.fill: parent
@@ -35,5 +33,12 @@ Window {
source: "graphics_qt5.qml"
objectName: "navit_loader"
}
+ Component.onCompleted: {
+ // orientation update mask is defined since QML 5.4 So make this compatible to 5.2
+ // by just calling this if available
+ if(Screen.hasOwnProperty('orientationUpdateMask')) {
+ Screen.orientationUpdateMask = Qt.PortraitOrientation + Qt.LandscapeOrientation + Qt.InvertedPortraitOrientation + Qt.InvertedLandscapeOrientation;
+ }
+ }
}
}