forked from demitov/dashApp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathClock.qml
43 lines (36 loc) · 864 Bytes
/
Clock.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
import QtQuick 2.9
import QtGraphicalEffects 1.0
Item {
id: clock
width: clockDigit.width
height: clockDigit.height
property int hours
property int minutes
function timeChanged() {
var date = new Date;
hours = date.getHours()
minutes = date.getMinutes()
}
Timer {
interval: 100; running: true; repeat: true;
onTriggered: clock.timeChanged()
}
Text {
id: clockDigit
font.pixelSize: 20
font.bold: true
font.family: "Eurostyle"
color: "white"
anchors.centerIn: parent
text: hours + ":" + minutes
}
DropShadow {
anchors.fill: clockDigit
horizontalOffset: 1
verticalOffset: 4
radius: 2.0
samples: 16
color: "grey"
source: clockDigit
}
}