blob: e660976b5f01eac438ee6f8dc94db7366b42c46b (
plain)
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
|
//
// [maya] components/SpClock.qml
//
// Implements custom clock component
//
// (c) 2016 Sanjeev Premi (spremi@ymail.com)
//
// SPDX-License-Identifier: MIT
// (https://spdx.org/licenses/MIT.html)
//
import QtQuick 2.0
Item {
id : sp_clock
property date value : new Date()
property color tColor : "white"
property alias tFont : sp_clock_text.font
implicitWidth : sp_clock_text.implicitWidth
implicitHeight : sp_clock_text.implicitHeight
Timer {
interval : 100
running : true
repeat : true;
onTriggered : sp_clock.value = new Date()
}
Text {
id : sp_clock_text
text : Qt.formatDateTime(sp_clock.value, "dddd, dd MMMM yyyy HH:mm AP")
color : sp_clock.tColor
font.pixelSize : 24
fontSizeMode : Text.VerticalFit
horizontalAlignment : Text.AlignHCenter
verticalAlignment : Text.AlignVCenter
}
}
|