-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathStaticClock.qml
42 lines (34 loc) · 999 Bytes
/
StaticClock.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
import QtQuick 2.2
Rectangle {
color: "#6F000000"
width: 260
height: 148
radius: 15
anchors.verticalCenter: parent.top
anchors.horizontalCenter: parent.left
Column {
anchors.top: parent.verticalCenter
anchors.topMargin: 4
anchors.left: parent.horizontalCenter
anchors.leftMargin: 10
StyledText {
id: time
anchors.horizontalCenter: parent.horizontalCenter
font.bold: true; font.pixelSize: 34
}
StyledText {
id: date
anchors.horizontalCenter: parent.horizontalCenter
font.bold: true; font.pixelSize: 14
}
}
function timeChanged() {
var dt = new Date;
time.text = dt.toLocaleTimeString(Qt.locale("en_UK"), "hh:mm");
date.text = dt.toLocaleDateString(Qt.locale("en_UK"), "ddd d MMM");
}
Timer {
interval: 100; running: true; repeat: true;
onTriggered: timeChanged()
}
}