forked from opelpanfan/PowerTune
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLaptimecontainer.qml
65 lines (59 loc) · 1.55 KB
/
Laptimecontainer.qml
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
import QtQuick 2.8
import QtQuick.Controls 1.4
Rectangle {
width: 400
height: 400
color: "black"
Connections{
target: Dashboard
onCurrentLapChanged :{
if (Dashboard.currentLap > 1)
{
laptimeModel.append({"lap":Dashboard.currentLap-1, "time":Dashboard.laptime})
laptimelistview.incrementCurrentIndex()
}
if (Dashboard.currentLap == 0){
laptimeModel.clear()
laptimelistview.currentIndex = 0
}
}
}
ListModel {
id: laptimeModel
}
Component {
id: contactDelegate
Item {
id:leftcolum
width: 400; height: 40
Row {
Column {
Text {
text: "LAP " + lap
width: 110
color: "white"
font.pixelSize: 15
font.bold: true}
}
Column {
Text { text: time
anchors.right: parent.right
width: 195
color: "white"
font.pixelSize: 30
font.bold: true}
}
}
}
}
ListView {
id: laptimelistview
width: 400
height: 200
anchors.bottom: parent.bottom
model: laptimeModel
delegate: contactDelegate
highlight: Rectangle { color: "#505050"; radius: 5}
focus: true
}
}