Skip to content
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

Closed
wants to merge 6 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
20 changes: 14 additions & 6 deletions data/themes/elarun/Main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -200,15 +200,23 @@ Rectangle {
}
}

Timer {
id: time
interval: 100
running: true
repeat: true

Copy link
Member

@plfiorini plfiorini Sep 14, 2016

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

onTriggered: {
dateTime.text = Qt.formatDateTime(new Date(), "dddd, dd MMMM yyyy HH:mm AP")
}
Copy link
Member

Choose a reason for hiding this comment

The 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

}
Copy link
Member

Choose a reason for hiding this comment

The 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
Copy link
Member

Choose a reason for hiding this comment

The 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

Copy link
Member

Choose a reason for hiding this comment

The 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
Expand Down