-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathmain.qml
244 lines (215 loc) · 4.69 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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
import QtQuick 2.12
import QtQuick.Window 2.12
Window {
id:root
visible: true
width: 480
height: 480
flags: Qt.FramelessWindowHint | Qt.Window
color: "transparent"
Image {
id: back
source: "qrc:/image/Image/back.png"
}
Image {
id: mPeople
x:186
y:213
width: 108
height: 120
source: "qrc:/people/Image/human (2).jpg"
}
onSceneGraphInitialized:
{
mTimer.start();
}
property string peopleurl : "qrc:/people/Image/human ("
property int peopleindex : 2;
Timer
{
id:mTimer
repeat: true
interval: 25
onTriggered:
{
peopleindex = peopleindex + 1
if(peopleindex === 61)
{
peopleindex = 2
}
mPeople.source = peopleurl + peopleindex + ").jpg"
mTime.text = Qt.formatDateTime(new Date(),"hh:mm")
mTimess.text = Qt.formatDateTime(new Date(),"ss")
}
}
Text {
id: mTime
y:120
x:90
text: Qt.formatDateTime(new Date(),"hh:mm")
font.family: "DigifaceWide"
font.letterSpacing: -5
font.weight: Font.Light
font.pointSize: 60
}
Text {
id: mTimess
anchors.bottom: mTime.bottom
anchors.bottomMargin: 10
anchors.left: mTime.right
anchors.leftMargin: 5
text: Qt.formatDateTime(new Date(),"ss")
font.family: "DigifaceWide"
font.letterSpacing: -2
font.weight: Font.Light
font.pointSize: 26
}
Text {
id: mYear
x:340
y:285
text: Qt.formatDateTime(new Date(),"dddd\r\nMM-dd")
font.family: "黑体"
font.weight: Font.Light
font.pointSize: 15
}
Text {
id: mHeart
x:118
y:326
text:"93"
font.family: "黑体"
font.weight: Font.Light
font.pointSize: 18
}
Text {
id: mHeartHL
x:75
y:300
text:"66-123"
font.family: "黑体"
font.weight: Font.Light
font.pointSize: 14
}
Text {
id: mHFoot
x:340
y:328
text:"8869"
font.family: "黑体"
font.weight: Font.Light
font.pointSize: 18
}
Text {
id: mSleep
x:180
y:368
font.bold: true
font.wordSpacing: 10
font.letterSpacing: 1
text:"8h36m"
font.family: "黑体"
font.weight: Font.Light
font.pointSize: 18
}
Text {
id: mDistance
x:200
y:410
font.bold: true
font.wordSpacing: 10
font.letterSpacing: 1
text:"9.36Km"
font.family: "黑体"
font.weight: Font.Light
font.pointSize: 18
}
Text {
id: mAir
x:215
y:50
font.bold: true
text:"空气优质"
font.family: "黑体"
font.weight: Font.Light
font.pointSize: 12
}
Text {
id: mWeather
anchors.left: mAir.left
anchors.top: mAir.bottom
anchors.topMargin: 5
font.bold: true
text:"晴天"
font.family: "黑体"
font.weight: Font.Light
font.pointSize: 12
}
Image {
id: mWeatherpic
x:318
y:75
width: 40
height: 40
source: "qrc:/image/Image/other2.png"
}
Text {
id: mTemperatureH
x:260
y:72
font.bold: true
text:"26℃"
font.family: "黑体"
font.weight: Font.Light
font.pointSize: 12
}
Text {
id: mTemperatureL
x:260
y:95
font.bold: true
text:"17℃"
font.family: "黑体"
font.weight: Font.Light
font.pointSize: 12
}
Text {
id: mTemperatureCurrent
anchors.left: mWeather.left
anchors.bottom: mTemperatureL.bottom
font.bold: true
text:"22℃"
font.family: "黑体"
font.weight: Font.Light
font.pointSize: 12
}
Text {
id: mRocket
x:120
y:85
font.bold: true
text:"88%"
font.family: "黑体"
font.weight: Font.Normal
font.pointSize: 20
}
MouseArea
{
anchors.fill: parent
property int m_x : 0;
property int m_y : 0;
onPressed:
{
m_x = mouse.x;
m_y = mouse.y;
}
onPositionChanged:
{
/*
实现窗口拖船,移动
*/
root.x = root.x + mouse.x - m_x
root.y = root.y + mouse.y - m_y
}
}
}