QML Example Use timer to update Date: Difference between revisions

From Qt Wiki
Jump to navigation Jump to search
No edit summary
(Add "cleanup" tag)
Line 1: Line 1:
{{Cleanup | reason=Auto-imported from ExpressionEngine.}}
[[Category:Developing_with_Qt::Qt Quick]]
[[Category:Developing_with_Qt::Qt Quick]]



Revision as of 16:22, 3 March 2015

This article may require cleanup to meet the Qt Wiki's quality standards. Reason: Auto-imported from ExpressionEngine.
Please improve this article if you can. Remove the {{cleanup}} tag and add this page to Updated pages list after it's clean.

Overview

An example demonstrating how Timer can be used to update Date() in a Text by updating it continuously using a timer.

import QtQuick 1.0

Rectangle {

id: main
width: 600; height: 300

Text {

id: foo
font.pointSize: 12
function set(){
foo.text = Date();
}
}

Timer {

id: textTimer
interval: 1000
repeat: true
running: true
triggeredOnStart: true
onTriggered: {
foo.set();
}
}

}