aboutsummaryrefslogtreecommitdiffstats
path: root/examples/quick/demos/stocqt/content/StockChart.qml
diff options
context:
space:
mode:
authorTopi Reinio <topi.reinio@digia.com>2013-10-08 14:35:55 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-11-04 11:45:57 +0100
commitb0dd9f3b314106bd3cd811ce02ff2cae5ee1eb50 (patch)
treecb9531623843944d4052a779355be3109066bbc4 /examples/quick/demos/stocqt/content/StockChart.qml
parenta79e400150e9d550cc4ddc0c0497778d8b78fe5d (diff)
Doc: Fix warnings in StocQt Qt Quick demo
Fix a number of warnings from QML engine by adding some boundary & sanity checks for properties. Also address UI update issues by having XMLHTTPRequest calls to trigger by a timer, instead of directly binding them to multiple change notifier signals. Task-number: QTBUG-33867 Change-Id: I48f573050b5dc3e3fe6e75bc423fe86ecc4a2469 Reviewed-by: Geir Vattekar <geir.vattekar@digia.com> Reviewed-by: Alan Alpert <aalpert@blackberry.com>
Diffstat (limited to 'examples/quick/demos/stocqt/content/StockChart.qml')
-rw-r--r--examples/quick/demos/stocqt/content/StockChart.qml5
1 files changed, 3 insertions, 2 deletions
diff --git a/examples/quick/demos/stocqt/content/StockChart.qml b/examples/quick/demos/stocqt/content/StockChart.qml
index 8235b5a632..f7e0d0206b 100644
--- a/examples/quick/demos/stocqt/content/StockChart.qml
+++ b/examples/quick/demos/stocqt/content/StockChart.qml
@@ -48,8 +48,8 @@ Rectangle {
property var _months: [ "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" ]
property var stockModel: null
- property var startDate
- property var endDate
+ property var startDate: new Date()
+ property var endDate: new Date()
property var settings
function update() {
@@ -228,6 +228,7 @@ Rectangle {
last = stockModel.indexOf(chart.endDate)
first = last - (chart.endDate.getTime() - chart.startDate.getTime())/86400000;
+ first = Math.max(first, 0);
console.log("painting... first:" + first + ", last:" + last);
var highestPrice = stockModel.highestPrice;