-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.qml
More file actions
33 lines (31 loc) · 875 Bytes
/
main.qml
File metadata and controls
33 lines (31 loc) · 875 Bytes
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
import QtQuick 2.15
import QtQuick.Window 2.15
import QtQuick.Layouts 1.3
import "qrc:/AnalogClockComponents" as Clock
Window {
width: 450
height: 450
visible: true
title: qsTr("Analog Clock")
function updateCurrentTime() {
var CurrentDateTime = new Date();
analogClockQML.minutes = CurrentDateTime.getMinutes();
analogClockQML.hours = CurrentDateTime.getHours();
analogClockQML.seconds = CurrentDateTime.getSeconds();
}
RowLayout{
anchors.fill: parent
Timer{
repeat: true
interval: 1000
running: true
onTriggered: updateCurrentTime();
}
Clock.AnalogClock {
id:analogClockQML
Layout.fillHeight: true
Layout.fillWidth: true
Component.onCompleted: updateCurrentTime();
}
}
}