diff options
author | Stefan Wildemann <metalstrolch@users.noreply.github.com> | 2017-06-05 05:26:48 +0200 |
---|---|---|
committer | Pierre GRANDIN <pgrandin@users.noreply.github.com> | 2017-06-04 20:26:48 -0700 |
commit | 58ac737ffea75559a9d4a6d9b1e6965a8770c593 (patch) | |
tree | a9f0c99d2bc024cd89be7f84b04349e1945bd8bf /navit/graphics/qt5 | |
parent | 825a26d1a3740a7d160bda468fd0a21dcd3d32b7 (diff) | |
download | navit-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.
Diffstat (limited to 'navit/graphics/qt5')
-rw-r--r-- | navit/graphics/qt5/loader.qml | 9 |
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; + } + } } } |