├── InnerRing.qml ├── KWNeedle.qml ├── LElementsModel.qml ├── LeftElement.qml ├── MainForm.ui.qml ├── README.md ├── RightElement.qml ├── SpeedNeedle.qml ├── SpeedoDigits.qml ├── Speedometer.qml ├── Tesla 19.29.21.textClipping ├── Tesla.pro ├── Tesla.pro.user ├── deployment.pri ├── main.cpp ├── main.qml ├── pics ├── Background.png ├── Efficiency.png ├── Empty.png ├── Energy.png ├── Lade-Balken.png ├── Media.png ├── Music.png ├── Navi.png ├── Numbers.png ├── Range.png ├── Street.png ├── Tacho.png ├── Tacho_Mitte.png ├── Tile.png ├── Trips.png ├── bg.png └── call.png └── qml.qrc /InnerRing.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.0 2 | import QtGraphicalEffects 1.0 3 | Item { 4 | 5 | property int speed: 0 6 | 7 | height: 335 //TODO: Groesse skalierbar machen 8 | width: height 9 | x: (parent.width / 2) - (width / 2) 10 | y: (parent.height / 2) - (height / 2) 11 | 12 | Image { 13 | id: innerRingRect 14 | height: parent.height 15 | width: parent.width 16 | source: "/pics/Tacho_Mitte.png" 17 | 18 | 19 | Text { 20 | id: speeddigit 21 | text: speed 22 | font.pixelSize: 86 23 | font.bold: true 24 | font.family: "Eurostile" 25 | y: 40 26 | color: "white" 27 | anchors.horizontalCenter: parent.horizontalCenter 28 | } 29 | 30 | DropShadow { 31 | anchors.fill: speeddigit 32 | horizontalOffset: 0 33 | verticalOffset: 8 34 | radius: 4.0 35 | samples: 16 36 | color: "black" 37 | source: speeddigit 38 | } 39 | 40 | Text { 41 | text: "mph" 42 | font.pixelSize: 16 43 | font.bold: true 44 | font.family: "Eurostile" 45 | y: 132 46 | color: "white" 47 | anchors.horizontalCenter: parent.horizontalCenter 48 | } 49 | 50 | Image { 51 | source: "/pics/Lade-Balken.png" 52 | anchors.horizontalCenter: parent.horizontalCenter 53 | y: parent.height /2 + 7 54 | } 55 | 56 | Text { 57 | text: "209" 58 | font.pixelSize: 34 59 | font.bold: true 60 | font.family: "Eurostile" 61 | y: 220 62 | color: "white" 63 | anchors.horizontalCenter: parent.horizontalCenter 64 | } 65 | 66 | Text { 67 | text: "Rated Range" 68 | font.pixelSize: 18 69 | font.bold: true 70 | font.family: "Eurostile" 71 | y: 260 72 | color: "#666666" 73 | anchors.horizontalCenter: parent.horizontalCenter 74 | } 75 | 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /KWNeedle.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.4 2 | import QtGraphicalEffects 1.0 3 | 4 | Canvas { 5 | id: canvas 6 | 7 | property int value : 0 8 | 9 | onValueChanged: {zeiger.rotation = Math.min(Math.max(10, canvas.value*3.5 - 90), 90); canvas.currentValue = zeiger.rotation - 90} 10 | //90 minrotation, 10 maxrotation 11 | width: parent.width; height: parent.height 12 | 13 | 14 | Rectangle { 15 | id: zeiger 16 | rotation: 90 //siehe minrotation 17 | width: 4 18 | height: parent.width / 2 19 | transformOrigin: Item.Bottom 20 | anchors.horizontalCenter: parent.horizontalCenter 21 | anchors.bottom: parent.verticalCenter 22 | 23 | antialiasing: true 24 | smooth: true 25 | color: "#FFC73E" 26 | onRotationChanged: {canvas.currentValue = zeiger.rotation - 90; canvas.requestPaint()} 27 | 28 | Behavior on rotation { 29 | NumberAnimation{ 30 | duration: 1000 31 | easing.type: Easing.OutExpo 32 | } 33 | } 34 | } 35 | 36 | 37 | 38 | 39 | antialiasing: true 40 | 41 | property color secondaryColor: zeiger.color 42 | 43 | property real centerWidth: width / 2 44 | property real centerHeight: height / 2 45 | property real radius: Math.min(canvas.width, canvas.height) / 2 46 | 47 | property real minimumValue: -360 48 | property real maximumValue: 0 49 | property real currentValue: -360 50 | 51 | // this is the angle that splits the circle in two arcs 52 | // first arc is drawn from 0 radians to angle radians 53 | // second arc is angle radians to 2*PI radians 54 | property real angle: (currentValue - minimumValue) / (maximumValue - minimumValue) * 2 * Math.PI + 0.0001 55 | property real angleOffset: Math.Pi//21.288 //to start at 0mph //-Math.PI / 2 56 | 57 | 58 | onPaint: { 59 | //Magic 60 | var ctx = getContext("2d"); 61 | ctx.save(); 62 | 63 | var gradient2 = ctx.createRadialGradient((parent.width / 2),(parent.height / 2), 500, (parent.width / 2),(parent.height / 2),5); 64 | gradient2.addColorStop(0.5, "#FFB108"); //oben 65 | gradient2.addColorStop(0.48, "#FFB108"); //oben 66 | gradient2.addColorStop(0.47, "#682E00"); //mitte 67 | gradient2.addColorStop(0.33, "transparent"); //unten 68 | 69 | ctx.clearRect(0, 0, canvas.width, canvas.height); 70 | 71 | ctx.beginPath(); 72 | ctx.lineWidth = 150; 73 | ctx.strokeStyle = gradient2 74 | ctx.arc(canvas.centerWidth, canvas.centerHeight, canvas.radius - (ctx.lineWidth / 2), canvas.angleOffset, canvas.angleOffset + canvas.angle, true); 75 | ctx.stroke(); 76 | 77 | ctx.restore(); 78 | 79 | } 80 | } 81 | 82 | -------------------------------------------------------------------------------- /LElementsModel.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.0 2 | 3 | ListModel { 4 | ListElement { 5 | name: "No Route" 6 | isource: "/pics/Navi.png" 7 | } 8 | ListElement { 9 | name: "Trips" 10 | isource: "/pics/Trips.png" 11 | } 12 | ListElement { 13 | name: "Range" 14 | isource: "/pics/Street.png" 15 | } 16 | ListElement { 17 | name: "Energy" 18 | isource: "/pics/Energy.png" 19 | } 20 | ListElement { 21 | name: "Media" 22 | isource: "/pics/Media.png" 23 | } 24 | ListElement { 25 | name: "Empty" 26 | isource: "/pics/Empty.png" 27 | } 28 | 29 | ListElement { 30 | name: "" 31 | isource: "" 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /LeftElement.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.0 2 | import QtGraphicalEffects 1.0 3 | 4 | Rectangle { 5 | id: container 6 | width: parent.width 7 | height: parent.height 8 | color: "black" 9 | 10 | Rectangle { 11 | id: appWindow 12 | width: parent.width 13 | height: parent.height + 20 14 | color: "black" 15 | y: parent.height + 20 16 | Image { 17 | id: appWindowImage 18 | anchors.verticalCenter: parent.verticalCenter 19 | x: (parent.width - 250) / 2 - width /2 20 | fillMode: Image.PreserveAspectFit 21 | scale: 1.2 22 | } 23 | } 24 | 25 | 26 | Image { 27 | id: hoverIcon 28 | x: 190// 29 | y: 194 30 | height: 120 31 | width: height 32 | source: "/pics/Tile.png" 33 | } 34 | 35 | 36 | property int pathMargin: 470 37 | 38 | PathView { 39 | id: menu 40 | width: 640 41 | height: -80 42 | 43 | model: LElementsModel {} 44 | delegate: Rectangle {height: 150; width: height; color:"transparent" 45 | Image {source: isource; fillMode: Image.PreserveAspectFit; anchors.horizontalCenter: parent.horizontalCenter;} 46 | Text {id:desc; text: name; 47 | anchors.horizontalCenter: parent.horizontalCenter; y: 88; 48 | font.pixelSize: 18; font.family: "Eurostile"; font.bold: true; color: "black"; 49 | } 50 | } 51 | 52 | 53 | path: Path { 54 | startX: 250 55 | startY: 600//pathMargin 56 | 57 | PathLine { x: 250; y: menu.height - pathMargin } 58 | } 59 | 60 | focus: false 61 | Keys.onDownPressed: decrementCurrentIndex() 62 | Keys.onUpPressed: incrementCurrentIndex() 63 | 64 | Keys.onReturnPressed: if(menu.opacity == 1) {selectApp(menu.currentIndex)} else {hideApp()} 65 | } 66 | 67 | 68 | function selectApp(ind) { 69 | switch(ind) { 70 | case 1: appWindowImage.source ="/pics/Efficiency.png"; appWindowImage.scale = 1.2; 71 | showApp() 72 | break; 73 | 74 | case 2: appWindowImage.source = "/pics/Music.png"; appWindowImage.scale = 1.4; 75 | showApp() 76 | break; 77 | 78 | case 0: appWindowImage.source = "/pics/Range.png"; appWindowImage.scale = 1.2; 79 | showApp() 80 | break; 81 | 82 | case 6: appWindowImage.source = "/pics/Numbers.png"; appWindowImage.scale = 1.2; 83 | showApp() 84 | break; 85 | 86 | default: 87 | break; 88 | } 89 | 90 | 91 | } 92 | 93 | function showApp() { 94 | animateOpacity.start() 95 | animateHover.start() 96 | appWindow.opacity = 1 97 | animateWindow.start() 98 | } 99 | 100 | 101 | function hideApp() { 102 | deanimateOpacity.start() 103 | deanimateHover.start() 104 | deanimateWindow.start() 105 | } 106 | 107 | NumberAnimation { 108 | id: animateOpacity; target: menu; properties: "opacity"; from: 1.00; to: 0.0; duration: 50 109 | } 110 | NumberAnimation { 111 | id: deanimateOpacity; target: menu; properties: "opacity"; from: 0.0; to: 1.0; duration: 500 112 | } 113 | NumberAnimation { 114 | id: animateHover; target: hoverIcon; properties: "opacity"; from: 1.00; to: 0.0; duration: 50 115 | } 116 | NumberAnimation { 117 | id: deanimateHover; target: hoverIcon; properties: "opacity"; from: 0.0; to: 1.0; duration: 500 118 | } 119 | NumberAnimation { 120 | id: animateWindow; target: appWindow; properties: "y"; from: parent.height; to: 0.0; duration: 1000; easing.type: Easing.OutExpo 121 | } 122 | NumberAnimation { 123 | id: deanimateWindow; target: appWindow; properties: "opacity"; from: 1.00; to: 0.0; duration: 500 124 | } 125 | } 126 | 127 | -------------------------------------------------------------------------------- /MainForm.ui.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.4 2 | import QtQuick.Controls 1.3 3 | import QtQuick.Layouts 1.1 4 | 5 | Item { 6 | width: 640 7 | height: 480 8 | 9 | property alias button3: button3 10 | property alias button2: button2 11 | property alias button1: button1 12 | 13 | RowLayout { 14 | anchors.centerIn: parent 15 | 16 | Button { 17 | id: button1 18 | text: qsTr("Press Me 1") 19 | } 20 | 21 | Button { 22 | id: button2 23 | text: qsTr("Press Me 2") 24 | } 25 | 26 | Button { 27 | id: button3 28 | text: qsTr("Press Me 3") 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Tesla Instrument Cluster (remodeled in Qt) 2 | This is a personal project, I worked on in June 2015, to get familiar with Qt. 3 | 4 | [Youtube-Link](https://www.youtube.com/watch?v=h8Iwe4iJXOc) 5 | -------------------------------------------------------------------------------- /RightElement.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.0 2 | import QtGraphicalEffects 1.0 3 | 4 | Rectangle { 5 | id: container 6 | width: parent.width 7 | height: parent.height 8 | color: "black" 9 | 10 | property int seconds 11 | property int tenseconds 12 | property int minutes 13 | 14 | Image { 15 | anchors.verticalCenter: parent.verticalCenter 16 | x: (parent.width - 250) - width/2 17 | fillMode: Image.PreserveAspectFit 18 | scale: 1.4 19 | source: "/pics/call.png" 20 | 21 | Text { 22 | id:callTime 23 | y: 165; x: 128 24 | font.family: "Eurostile"; color: "white"; font.pixelSize: 11 25 | text: minutes + ":" + tenseconds + seconds 26 | } 27 | } 28 | 29 | Timer { 30 | //update Calltime, calculate 60 seconds into 1 minute etc. 31 | interval: 1000; running: true; repeat: true 32 | onTriggered: {seconds++; 33 | 34 | if(seconds == 10){ 35 | tenseconds += 1 36 | seconds = 0 37 | } 38 | if(seconds == 0 && tenseconds==6){ 39 | minutes += 1 40 | seconds = 0 41 | tenseconds = 0 42 | } 43 | } 44 | } 45 | } 46 | 47 | -------------------------------------------------------------------------------- /SpeedNeedle.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.4 2 | import QtGraphicalEffects 1.0 3 | 4 | Canvas { 5 | id: canvas 6 | 7 | property int value : 0 8 | 9 | onValueChanged: {zeiger.rotation = Math.min(Math.max(-250, canvas.value*3.5 - 149), -30); canvas.currentValue = zeiger.rotation - 211} //130 minrotation, -30 maxrotation 10 | width: parent.width; height: parent.height 11 | 12 | Rectangle { 13 | id: zeiger 14 | rotation: -149 //siehe minrotation 15 | width: 4 16 | height: parent.width / 2 17 | transformOrigin: Item.Bottom 18 | anchors.horizontalCenter: parent.horizontalCenter 19 | anchors.bottom: parent.verticalCenter 20 | 21 | smooth: true 22 | antialiasing: true 23 | color: "#81FFFE" 24 | onRotationChanged: {canvas.currentValue = zeiger.rotation - 211; canvas.requestPaint()}//texti.text = zeiger.rotation 25 | 26 | Behavior on rotation { 27 | NumberAnimation{ 28 | duration: 15000 29 | easing.type: Easing.OutCirc 30 | } 31 | } 32 | } 33 | 34 | 35 | antialiasing: true 36 | 37 | property color secondaryColor: zeiger.color 38 | 39 | property real centerWidth: width / 2 40 | property real centerHeight: height / 2 41 | property real radius: Math.min(canvas.width, canvas.height) / 2 42 | 43 | property real minimumValue: -360 44 | property real maximumValue: 0 45 | property real currentValue: -360 46 | 47 | // this is the angle that splits the circle in two arcs 48 | // first arc is drawn from 0 radians to angle radians 49 | // second arc is angle radians to 2*PI radians 50 | property real angle: (currentValue - minimumValue) / (maximumValue - minimumValue) * 2 * Math.PI + 0.01 51 | property real angleOffset: 20.955 //to start at 0mph //-Math.PI / 2 52 | 53 | 54 | onPaint: { 55 | var ctx = getContext("2d"); 56 | ctx.save(); 57 | 58 | var gradient2 = ctx.createRadialGradient((parent.width / 2),(parent.height / 2), 0, (parent.width / 2),(parent.height / 2),parent.height); 59 | gradient2.addColorStop(0.5, "#81FFFE"); //oben 60 | gradient2.addColorStop(0.46, "#81FFFE"); //oben 61 | gradient2.addColorStop(0.45, "#112478"); //mitte 62 | gradient2.addColorStop(0.33, "transparent"); //unten 63 | 64 | ctx.clearRect(0, 0, canvas.width, canvas.height); 65 | 66 | ctx.beginPath(); 67 | ctx.lineWidth = 150; 68 | ctx.strokeStyle = gradient2 69 | ctx.arc(canvas.centerWidth, canvas.centerHeight, canvas.radius - (ctx.lineWidth / 2), canvas.angleOffset, canvas.angleOffset + canvas.angle); 70 | ctx.stroke(); 71 | 72 | ctx.restore(); 73 | } 74 | } 75 | 76 | -------------------------------------------------------------------------------- /SpeedoDigits.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.0 2 | 3 | Repeater { 4 | model: 5 5 | delegate: Item { 6 | height: parent.radius - width * 2 + 44 7 | width: 44 8 | //height: parent.height - 100// - width * 2 9 | //y: parent.height 10 | rotation: 25 * (index + 211) 11 | transformOrigin: Item.Bottom 12 | anchors.horizontalCenter: parent.horizontalCenter 13 | 14 | Text { 15 | anchors.horizontalCenter: parent.horizontalCenter 16 | anchors.top: parent.top 17 | text: "height:" + parent.height + ", width:" + parent.width + ", rotation:" + rotation//(index * 2 + 2) * 10 18 | rotation: -parent.rotation 19 | font.pixelSize: 20 20 | font.bold: true 21 | color: "#888888" 22 | } 23 | } 24 | } 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /Speedometer.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.4 2 | import QtGraphicalEffects 1.0 3 | 4 | Rectangle { 5 | color: "transparent" 6 | 7 | SpeedNeedle { 8 | id: speedoNeedle 9 | 10 | anchors.verticalCenterOffset: 0 11 | anchors.centerIn: parent 12 | 13 | focus: true 14 | Keys.onPressed: { 15 | if (event.key == Qt.Key_Space && !event.isAutoRepeat) { 16 | speedoNeedle.value = 100 17 | kWNeedle.value = 0 18 | drive() 19 | } 20 | } 21 | Keys.onReleased: { 22 | if (event.key == Qt.Key_Space && !event.isAutoRepeat) { 23 | speedoNeedle.value = 0 24 | kWNeedle.value = 100 25 | }}} 26 | 27 | KWNeedle { 28 | id: kWNeedle 29 | anchors.verticalCenterOffset: 0 30 | anchors.centerIn: parent 31 | value: 100 32 | } 33 | 34 | 35 | InnerRing { 36 | id: innerring 37 | speed: (Math.round(speedoNeedle.currentValue, 0) + 360) * 0.68 38 | } 39 | 40 | //Letter: P R N D 41 | Grid { 42 | anchors.horizontalCenter: parent.horizontalCenter 43 | y: parent.height - 65 44 | columns: 4 45 | Rectangle { color: "transparent"; width: 25; height: 25 46 | Text { 47 | id: letterP 48 | text: " P " 49 | font.family: "Eurostile"; font.pixelSize: 36 50 | color: "white" 51 | anchors.centerIn: parent 52 | } } 53 | Rectangle { color: "transparent"; width: 25; height: 25 54 | Text { 55 | text: " R " 56 | font.family: "Eurostile"; font.pixelSize: 18 57 | color: "darkgray" 58 | anchors.centerIn: parent 59 | }} 60 | Rectangle { color: "transparent"; width: 25; height: 25 61 | Text { 62 | text: " N " 63 | font.family: "Eurostile"; font.pixelSize: 18 64 | color: "darkgray" 65 | anchors.centerIn: parent 66 | }} 67 | Rectangle { color: "transparent"; width: 25; height: 25 68 | Text { 69 | id: letterD 70 | text: " D " 71 | font.family: "Eurostile"; font.pixelSize: 18 72 | color: "darkgray" 73 | anchors.centerIn: parent 74 | }} 75 | } 76 | 77 | function drive() { 78 | letterD.font.bold = true 79 | letterD.color = "white" 80 | letterD.font.pixelSize = 36 81 | letterP.font.bold = false 82 | letterP.color = "darkgray" 83 | letterP.font.pixelSize = 18 84 | } 85 | 86 | 87 | } 88 | 89 | 90 | 91 | -------------------------------------------------------------------------------- /Tesla 19.29.21.textClipping: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alex-adam/Tesla/6a983eb92f8302395db5a1887540798aaddd9f1a/Tesla 19.29.21.textClipping -------------------------------------------------------------------------------- /Tesla.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = app 2 | 3 | QT += qml quick widgets 4 | 5 | SOURCES += main.cpp 6 | 7 | RESOURCES += qml.qrc 8 | 9 | # Additional import path used to resolve QML modules in Qt Creator's code model 10 | QML_IMPORT_PATH = 11 | 12 | # Default rules for deployment. 13 | include(deployment.pri) 14 | -------------------------------------------------------------------------------- /Tesla.pro.user: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | EnvironmentId 7 | {b67b0715-94cf-47fe-839b-ba3f8fb7af06} 8 | 9 | 10 | ProjectExplorer.Project.ActiveTarget 11 | 0 12 | 13 | 14 | ProjectExplorer.Project.EditorSettings 15 | 16 | true 17 | false 18 | true 19 | 20 | Cpp 21 | 22 | CppGlobal 23 | 24 | 25 | 26 | QmlJS 27 | 28 | QmlJSGlobal 29 | 30 | 31 | 2 32 | UTF-8 33 | false 34 | 4 35 | false 36 | 80 37 | true 38 | true 39 | 1 40 | true 41 | false 42 | 0 43 | true 44 | 0 45 | 8 46 | true 47 | 1 48 | true 49 | true 50 | true 51 | false 52 | 53 | 54 | 55 | ProjectExplorer.Project.PluginSettings 56 | 57 | 58 | 59 | ProjectExplorer.Project.Target.0 60 | 61 | Desktop Qt 5.4.1 clang 64bit 62 | Desktop Qt 5.4.1 clang 64bit 63 | qt.54.clang_64_kit 64 | 0 65 | 0 66 | 0 67 | 68 | /Users/alex/Development/QT_Projects/build-Tesla-Desktop_Qt_5_4_1_clang_64bit-Debug 69 | 70 | 71 | true 72 | qmake 73 | 74 | QtProjectManager.QMakeBuildStep 75 | true 76 | false 77 | 78 | false 79 | false 80 | 81 | 82 | true 83 | Make 84 | 85 | Qt4ProjectManager.MakeStep 86 | 87 | -w 88 | -r 89 | 90 | false 91 | 92 | 93 | 94 | 2 95 | Build 96 | 97 | ProjectExplorer.BuildSteps.Build 98 | 99 | 100 | 101 | true 102 | Make 103 | 104 | Qt4ProjectManager.MakeStep 105 | 106 | -w 107 | -r 108 | 109 | true 110 | clean 111 | 112 | 113 | 1 114 | Clean 115 | 116 | ProjectExplorer.BuildSteps.Clean 117 | 118 | 2 119 | false 120 | 121 | Debug 122 | 123 | Qt4ProjectManager.Qt4BuildConfiguration 124 | 2 125 | true 126 | 127 | 128 | /Users/alex/Development/QT_Projects/build-Tesla-Desktop_Qt_5_4_1_clang_64bit-Release 129 | 130 | 131 | true 132 | qmake 133 | 134 | QtProjectManager.QMakeBuildStep 135 | false 136 | true 137 | 138 | false 139 | false 140 | 141 | 142 | true 143 | Make 144 | 145 | Qt4ProjectManager.MakeStep 146 | 147 | -w 148 | -r 149 | 150 | false 151 | 152 | 153 | 154 | 2 155 | Build 156 | 157 | ProjectExplorer.BuildSteps.Build 158 | 159 | 160 | 161 | true 162 | Make 163 | 164 | Qt4ProjectManager.MakeStep 165 | 166 | -w 167 | -r 168 | 169 | true 170 | clean 171 | 172 | 173 | 1 174 | Clean 175 | 176 | ProjectExplorer.BuildSteps.Clean 177 | 178 | 2 179 | false 180 | 181 | Release 182 | 183 | Qt4ProjectManager.Qt4BuildConfiguration 184 | 0 185 | true 186 | 187 | 2 188 | 189 | 190 | 0 191 | Deploy 192 | 193 | ProjectExplorer.BuildSteps.Deploy 194 | 195 | 1 196 | Deploy locally 197 | 198 | ProjectExplorer.DefaultDeployConfiguration 199 | 200 | 1 201 | 202 | 203 | 204 | false 205 | false 206 | false 207 | false 208 | true 209 | 0.01 210 | 10 211 | true 212 | 1 213 | 25 214 | 215 | 1 216 | true 217 | false 218 | true 219 | valgrind 220 | 221 | 0 222 | 1 223 | 2 224 | 3 225 | 4 226 | 5 227 | 6 228 | 7 229 | 8 230 | 9 231 | 10 232 | 11 233 | 12 234 | 13 235 | 14 236 | 237 | 2 238 | 239 | Tesla 240 | 241 | Qt4ProjectManager.Qt4RunConfiguration:/Users/alex/Development/QT_Projects/Tesla/Tesla.pro 242 | 243 | Tesla.pro 244 | false 245 | false 246 | 247 | 3768 248 | false 249 | true 250 | false 251 | false 252 | true 253 | 254 | 1 255 | 256 | 257 | 258 | ProjectExplorer.Project.TargetCount 259 | 1 260 | 261 | 262 | ProjectExplorer.Project.Updater.FileVersion 263 | 18 264 | 265 | 266 | Version 267 | 18 268 | 269 | 270 | -------------------------------------------------------------------------------- /deployment.pri: -------------------------------------------------------------------------------- 1 | android-no-sdk { 2 | target.path = /data/user/qt 3 | export(target.path) 4 | INSTALLS += target 5 | } else:android { 6 | x86 { 7 | target.path = /libs/x86 8 | } else: armeabi-v7a { 9 | target.path = /libs/armeabi-v7a 10 | } else { 11 | target.path = /libs/armeabi 12 | } 13 | export(target.path) 14 | INSTALLS += target 15 | } else:unix { 16 | isEmpty(target.path) { 17 | qnx { 18 | target.path = /tmp/$${TARGET}/bin 19 | } else { 20 | target.path = /opt/$${TARGET}/bin 21 | } 22 | export(target.path) 23 | } 24 | INSTALLS += target 25 | } 26 | 27 | export(INSTALLS) 28 | -------------------------------------------------------------------------------- /main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main(int argc, char *argv[]) 5 | { 6 | QApplication app(argc, argv); 7 | 8 | QQmlApplicationEngine engine; 9 | engine.load(QUrl(QStringLiteral("qrc:/main.qml"))); 10 | 11 | return app.exec(); 12 | } 13 | -------------------------------------------------------------------------------- /main.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.4 2 | import QtQuick.Controls 1.3 3 | import QtQuick.Window 2.2 4 | import QtQuick.Dialogs 1.2 5 | import QtQuick.Layouts 1.1 6 | 7 | ApplicationWindow { 8 | title: qsTr("Tesla Model S Speedometer") 9 | width: 1400 10 | height: 600 11 | visible: true 12 | color: "black" 13 | 14 | LeftElement { 15 | y: 50 16 | width: parent.width / 2 17 | height: 450 18 | } 19 | 20 | RightElement { 21 | id: rightRect 22 | y: 50 23 | x: parent.width / 2 24 | width: parent.width / 2 25 | height: 475 26 | } 27 | 28 | 29 | QtObject { 30 | property var locale: Qt.locale() 31 | property date currentDate: new Date() 32 | property string dateString 33 | property string timeString 34 | 35 | Component.onCompleted: { 36 | dateString = currentDate.toLocaleDateString(); 37 | timeString = currentDate.toLocaleTimeString(); 38 | } 39 | } 40 | 41 | 42 | Image { 43 | width: parent.width 44 | height: parent.height 45 | source: "/pics/Background.png" 46 | } 47 | 48 | 49 | //Leiste unten 50 | Rectangle { 51 | y: parent.height - 90 52 | height: 200 53 | width: parent.width 54 | color: "transparent" 55 | RowLayout { 56 | y: 50 57 | x: 200 58 | Text { 59 | text: "245" 60 | font.pixelSize: 20 61 | font.bold: true 62 | color: "white" 63 | } 64 | Text { 65 | text: "mi" 66 | font.pixelSize: 20 67 | font.bold: false 68 | color: "darkgray" 69 | } 70 | } 71 | 72 | RowLayout { 73 | y: 50 74 | x: 350 75 | Text { 76 | text: "69º" 77 | font.pixelSize: 20 78 | font.bold: true 79 | color: "white" 80 | } 81 | Text { 82 | text: "F" 83 | font.pixelSize: 20 84 | font.bold: false 85 | color: "darkgray" 86 | } 87 | } 88 | 89 | 90 | RowLayout { 91 | y: 50 92 | x: 950 93 | Text { 94 | text: new Date().toLocaleDateString(Qt.locale(),"ddd") //ddd MMM d //h:mm AP 95 | font.pixelSize: 20 96 | font.bold: true 97 | color: "white" 98 | } 99 | Text { 100 | text: new Date().toLocaleDateString(Qt.locale(),"MMM d") //ddd MMM d //h:mm AP 101 | font.pixelSize: 20 102 | font.bold: false 103 | color: "darkgray" 104 | } 105 | } 106 | 107 | RowLayout { 108 | y: 50 109 | x: 1100 110 | Text { 111 | text: new Date().toLocaleTimeString(Qt.locale(),"h:mm") //ddd MMM d //h:mm AP 112 | font.pixelSize: 20 113 | font.bold: false 114 | color: "darkgray" 115 | } 116 | Text { 117 | text: new Date().toLocaleTimeString(Qt.locale(),"AP") //ddd MMM d //h:mm AP 118 | font.pixelSize: 20 119 | font.bold: true 120 | color: "white" 121 | } 122 | } 123 | } 124 | 125 | //Tacho 126 | Image { 127 | height: parent.height 128 | width: height 129 | x: (parent.width / 2) - (width / 2) 130 | scale: 1.14 131 | source: "/pics/Tacho.png" 132 | fillMode: Image.PreserveAspectFit 133 | } 134 | 135 | Speedometer { 136 | height: 525 137 | width: height 138 | x: (parent.width / 2) - (width / 2) 139 | y: (parent.height / 2) - (height / 2) 140 | } 141 | } 142 | 143 | 144 | -------------------------------------------------------------------------------- /pics/Background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alex-adam/Tesla/6a983eb92f8302395db5a1887540798aaddd9f1a/pics/Background.png -------------------------------------------------------------------------------- /pics/Efficiency.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alex-adam/Tesla/6a983eb92f8302395db5a1887540798aaddd9f1a/pics/Efficiency.png -------------------------------------------------------------------------------- /pics/Empty.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alex-adam/Tesla/6a983eb92f8302395db5a1887540798aaddd9f1a/pics/Empty.png -------------------------------------------------------------------------------- /pics/Energy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alex-adam/Tesla/6a983eb92f8302395db5a1887540798aaddd9f1a/pics/Energy.png -------------------------------------------------------------------------------- /pics/Lade-Balken.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alex-adam/Tesla/6a983eb92f8302395db5a1887540798aaddd9f1a/pics/Lade-Balken.png -------------------------------------------------------------------------------- /pics/Media.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alex-adam/Tesla/6a983eb92f8302395db5a1887540798aaddd9f1a/pics/Media.png -------------------------------------------------------------------------------- /pics/Music.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alex-adam/Tesla/6a983eb92f8302395db5a1887540798aaddd9f1a/pics/Music.png -------------------------------------------------------------------------------- /pics/Navi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alex-adam/Tesla/6a983eb92f8302395db5a1887540798aaddd9f1a/pics/Navi.png -------------------------------------------------------------------------------- /pics/Numbers.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alex-adam/Tesla/6a983eb92f8302395db5a1887540798aaddd9f1a/pics/Numbers.png -------------------------------------------------------------------------------- /pics/Range.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alex-adam/Tesla/6a983eb92f8302395db5a1887540798aaddd9f1a/pics/Range.png -------------------------------------------------------------------------------- /pics/Street.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alex-adam/Tesla/6a983eb92f8302395db5a1887540798aaddd9f1a/pics/Street.png -------------------------------------------------------------------------------- /pics/Tacho.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alex-adam/Tesla/6a983eb92f8302395db5a1887540798aaddd9f1a/pics/Tacho.png -------------------------------------------------------------------------------- /pics/Tacho_Mitte.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alex-adam/Tesla/6a983eb92f8302395db5a1887540798aaddd9f1a/pics/Tacho_Mitte.png -------------------------------------------------------------------------------- /pics/Tile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alex-adam/Tesla/6a983eb92f8302395db5a1887540798aaddd9f1a/pics/Tile.png -------------------------------------------------------------------------------- /pics/Trips.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alex-adam/Tesla/6a983eb92f8302395db5a1887540798aaddd9f1a/pics/Trips.png -------------------------------------------------------------------------------- /pics/bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alex-adam/Tesla/6a983eb92f8302395db5a1887540798aaddd9f1a/pics/bg.png -------------------------------------------------------------------------------- /pics/call.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alex-adam/Tesla/6a983eb92f8302395db5a1887540798aaddd9f1a/pics/call.png -------------------------------------------------------------------------------- /qml.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | main.qml 4 | MainForm.ui.qml 5 | InnerRing.qml 6 | Speedometer.qml 7 | SpeedNeedle.qml 8 | KWNeedle.qml 9 | pics/Tacho.png 10 | LElementsModel.qml 11 | LeftElement.qml 12 | pics/Tacho_Mitte.png 13 | pics/Background.png 14 | pics/Trips.png 15 | pics/Tile.png 16 | pics/Street.png 17 | pics/Range.png 18 | pics/Numbers.png 19 | pics/Navi.png 20 | pics/Music.png 21 | pics/Media.png 22 | pics/Lade-Balken.png 23 | pics/Energy.png 24 | pics/Empty.png 25 | pics/Efficiency.png 26 | RightElement.qml 27 | pics/call.png 28 | 29 | 30 | --------------------------------------------------------------------------------