aboutsummaryrefslogtreecommitdiffstats
path: root/examples/quick/demos/stocqt/stocqt.qml
diff options
context:
space:
mode:
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()
}
}