summaryrefslogtreecommitdiffstats
path: root/demo3/vertical/tbtnavi_demo/app/qml/DateAndTime.qml
blob: c9e2af7a32ace7245e909ed433130c5396cdd9d8 (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
import QtQuick 2.0
import QtQuick.Controls 2.2
import QtQuick.Layouts 1.0

Item {
    id: dateAndTime

    width: 53 * hspan
    height: 33 * vspan

    property int hspan: 4
    property int vspan: 1
    property var currentDate: new Date();

    RowLayout {
        anchors.top: parent.top
        anchors.horizontalCenter: parent.horizontalCenter
        spacing: 10

        CustomLabel {
            font.capitalization: Font.AllUppercase
            text: Qt.formatDateTime(dateAndTime.currentDate, "HH:mm")
            font.pixelSize: 38
            color: "#000000"
        }
    }

    Timer {
        interval: 60000
        running: true
        repeat: true

        onTriggered: {
            dateAndTime.currentDate = new Date();
        }
    }
}