-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.qml
131 lines (105 loc) · 3.27 KB
/
main.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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
import QtQuick 2.9
import QtQuick.Window 2.2
import QtQuick.Controls 2.2
import QtQuick.Controls.Material 2.2
Window {
visible: true
width: 800
height: 600
Material.theme: Material.Light
Material.accent: Material.Purple
Connections {
target: MyClass
// signal newData()
onNewData: {
labelInfo.text = value;
}
/*
onChangedClock: {
labelTime.text = MyClass.clock;
}
*/
}
SwipeView {
id: view
currentIndex: 0
anchors.fill: parent
Item {
id: pageOne
Rectangle {
anchors.fill: parent
color: "#323232"
Text {
id: labelInfo
width: parent.width
height: parent.height/2
horizontalAlignment: Text.AlignHCenter
font.pointSize: parent.width*0.2
style: Text.Sunken
color: "#D3D3D3"
text: "00"
}
Slider {
id: slider
anchors.bottom: parent.bottom
anchors.margins: 20
width: parent.width
height: 50
from: 1
value: 10
to: 100
onValueChanged: {
// Call function newValuePot() in MyClass
MyClass.newValuePot(slider.value);
}
}
}
}
Item {
id: pageTwo
Rectangle {
anchors.fill: parent
color: "#323232"
Text {
id: labelTime
width: parent.width
height: parent.height/2
horizontalAlignment: Text.AlignHCenter
font.pointSize: parent.width*0.16
style: Text.Sunken
color: "#D3D3D3"
text: MyClass.clock
}
Button {
id: buttonAction
width: parent.width/4
height: parent.height/10
anchors.top: labelTime.bottom
anchors.horizontalCenter: parent.horizontalCenter
highlighted: true
Material.accent: Material.Orange
text: "START"
MouseArea {
anchors.fill: parent
onClicked: {
if (buttonAction.text === "START") {
buttonAction.text = "STOP";
MyClass.startTimer();
} else {
buttonAction.text = "START";
MyClass.stopTimer();
}
}
}
}
}
}
}
PageIndicator {
id: indicator
count: view.count
currentIndex: view.currentIndex
anchors.bottom: view.bottom
anchors.horizontalCenter: parent.horizontalCenter
}
}