-
Notifications
You must be signed in to change notification settings - Fork 327
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
date and time now updating properly #698
Changes from all commits
142fd61
c0c383e
9a3e9e8
b15d8f2
f67521a
2efb9c5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -200,15 +200,23 @@ Rectangle { | |
} | ||
} | ||
|
||
Timer { | ||
id: time | ||
interval: 100 | ||
running: true | ||
repeat: true | ||
|
||
onTriggered: { | ||
dateTime.text = Qt.formatDateTime(new Date(), "dddd, dd MMMM yyyy HH:mm AP") | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. formatting seems a bit off here, you should use 4 spaces to indent |
||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this way |
||
|
||
Text { | ||
id: time_label | ||
id: dateTime | ||
anchors.right: parent.right | ||
anchors.bottom: parent.bottom | ||
|
||
text: Qt.formatDateTime(new Date(), "dddd, dd MMMM yyyy HH:mm AP") | ||
|
||
anchors.bottom: parent.bottom | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. do not add spaces at the end of the line |
||
horizontalAlignment: Text.AlignRight | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. do not indent empty lines |
||
color: "#0b678c" | ||
font.bold: true | ||
font.pixelSize: 12 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what was wrong with the previous version is here, by using a Timer that updates a dateTime property you should be able to update the clock, moving this Text here into a container is not needed