add testqt source
[apps/navigation.git] / app / ImgDestinationDirection.qml
diff --git a/app/ImgDestinationDirection.qml b/app/ImgDestinationDirection.qml
new file mode 100755 (executable)
index 0000000..e6c36d5
--- /dev/null
@@ -0,0 +1,83 @@
+import QtQuick 2.0\r
+\r
+Item {\r
+       id: img_destination_direction\r
+\r
+       width: childrenRect.width\r
+       height: childrenRect.height\r
+\r
+       function settleState() {\r
+               if(img_destination_direction.state == "1"){\r
+                       img_destination_direction.state = "2";\r
+               } else if(img_destination_direction.state == "2"){\r
+                       img_destination_direction.state = "3";\r
+               } else if(img_destination_direction.state == "3"){\r
+                       img_destination_direction.state = "4";\r
+               } else if(img_destination_direction.state == "4"){\r
+                       img_destination_direction.state = "5";\r
+               } else if(img_destination_direction.state == "5"){\r
+                       img_destination_direction.state = "6";\r
+               } else if(img_destination_direction.state == "6"){\r
+                       img_destination_direction.state = "7";\r
+               } else if(img_destination_direction.state == "7"){\r
+                       img_destination_direction.state = "8";\r
+               } else if(img_destination_direction.state == "8"){\r
+                       img_destination_direction.state = "9";\r
+               } else {\r
+                       img_destination_direction.state = "1";\r
+               }\r
+       }\r
+\r
+       Image {\r
+               id: direction\r
+               x: 0\r
+               y: 0\r
+               width: 100\r
+               height: 100\r
+               source: "images/1_uturn.png"\r
+\r
+               MouseArea {\r
+                       anchors.fill: parent\r
+                       onClicked: { settleState() }\r
+               }\r
+       }\r
+\r
+       states: [\r
+               State {\r
+                       name: "1"\r
+                       PropertyChanges { target: direction; source: "images/1_uturn.png" }\r
+               },\r
+               State {\r
+                       name: "2"\r
+                       PropertyChanges { target: direction; source: "images/2_sharp_right.png" }\r
+               },\r
+               State {\r
+                       name: "3"\r
+                       PropertyChanges { target: direction; source: "images/3_right.png" }\r
+               },\r
+               State {\r
+                       name: "4"\r
+                       PropertyChanges { target: direction; source: "images/4_slight_right.png" }\r
+               },\r
+               State {\r
+                       name: "5"\r
+                       PropertyChanges { target: direction; source: "images/5_straight.png" }\r
+               },\r
+               State {\r
+                       name: "6"\r
+                       PropertyChanges { target: direction; source: "images/6_slight_left.png" }\r
+               },\r
+               State {\r
+                       name: "7"\r
+                       PropertyChanges { target: direction; source: "images/7_left.png" }\r
+               },\r
+               State {\r
+                       name: "8"\r
+                       PropertyChanges { target: direction; source: "images/8_sharp_left.png" }\r
+               },\r
+               State {\r
+                       name: "9"\r
+                       PropertyChanges { target: direction; source: "images/Dest_Flag.jpg" }\r
+               }\r
+       ]\r
+}\r