aboutsummaryrefslogtreecommitdiffstats
path: root/examples/quick/demos/stocqt/stocqt.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/stocqt.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/stocqt.qml')
-rw-r--r--examples/quick/demos/stocqt/stocqt.qml14
1 files changed, 10 insertions, 4 deletions
diff --git a/examples/quick/demos/stocqt/stocqt.qml b/examples/quick/demos/stocqt/stocqt.qml
index 9bcffd972f..3e231ab8bf 100644
--- a/examples/quick/demos/stocqt/stocqt.qml
+++ b/examples/quick/demos/stocqt/stocqt.qml
@@ -52,17 +52,23 @@ ListView {
boundsBehavior: Flickable.StopAtBounds
currentIndex: 1
+ Timer {
+ id: updateTimer
+ interval: 500
+ onTriggered: stock.updateStock()
+ }
+
StockModel {
id: stock
stockId: listView.currentStockId
stockName: listView.currentStockName
startDate: settings.startDate
endDate: settings.endDate
- onStockIdChanged: updateStock()
- onStartDateChanged: updateStock()
- onEndDateChanged: updateStock()
+ onStockIdChanged: updateTimer.restart()
+ onStartDateChanged: updateTimer.restart()
+ onEndDateChanged: updateTimer.restart()
onDataReady: {
- root.currentIndex = 1
+ root.positionViewAtIndex(1, ListView.SnapPosition)
stockView.update()
}
}