mirror of
https://github.com/brmlab/brmbar.git
synced 2025-06-08 21:33:59 +02:00
26 lines
604 B
QML
26 lines
604 B
QML
import QtQuick 1.1
|
|
|
|
Rectangle {
|
|
id: clock
|
|
width: 320
|
|
height: 65
|
|
property variant now: new Date()
|
|
property string textColor: "#000000"
|
|
property real textSize: 0.768 * 16
|
|
Timer {
|
|
id: clockUpdater
|
|
interval: 1000 // update clock every second
|
|
running: true
|
|
repeat: true
|
|
onTriggered: {
|
|
parent.now = new Date()
|
|
}
|
|
}
|
|
Text {
|
|
id: clockLabel
|
|
anchors.centerIn: parent
|
|
text: Qt.formatDateTime(parent.now, "hh:mm:ss")
|
|
color: parent.textColor
|
|
font.pixelSize: parent.textSize
|
|
}
|
|
}
|