qmlmirror/Clock.qml
Oscar Andreasson f5ac3d5ffd Initial release
2015-05-27 16:14:00 -07:00

44 lines
1 KiB
QML

import QtQuick 2.2
import QtQuick.Layouts 1.1
import QtQuick.Controls 1.1
import QtQuick.Window 2.0
Rectangle {
// title: qsTr("Hello World")
width: 480
height: 200
color: "#000000"
property date currDate: new Date()
Timer {
interval: 500; running: true; repeat: true
onTriggered: {
currDate = new Date()
time.text = currDate.toTimeString()
datum.text = currDate.toDateString()
}
}
ColumnLayout {
id: layout
anchors.fill: parent
Text {
id: time
// anchors.top: parent.top
font.pointSize: 48
font.family: "Helvetica"
color: "#ffffff"
anchors.horizontalCenter: parent.horizontalCenter
}
Text {
id: datum
// anchors.bottom: parent.bottom
anchors.horizontalCenter: parent.horizontalCenter
font.pointSize: 24
color: "#ffffff"
font.family: "Helvetica"
}
}
}