summaryrefslogtreecommitdiff
path: root/navit/graphics/qt5/loader.qml
blob: ed9425bf7f6718bd3e6f777024bf131e6d76b441 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import com.navit.graphics_qt5 1.0
import QtQuick 2.2
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
       Loader {
           width: root.width
	   height: root.height
	   anchors.centerIn: parent
	   Screen.onOrientationChanged: {
	       rotation = Screen.angleBetween(Screen.orientation , Screen.primaryOrientation)
	       switch(Screen.angleBetween(Screen.orientation , Screen.primaryOrientation))
	       {
	           case 0:
		   case 180:
		       width = root.width
		       height = root.height
		   break
		   case 90:
		   case 270:
		   width = root.height
		   height = root.width
		   break
	       }
           }
           id: navit_loader
           focus: true
           source: "graphics_qt5.qml"
           objectName: "navit_loader"
       }
   }
}