aboutsummaryrefslogtreecommitdiffstats
path: root/examples/quick/demos/stocqt/stocqt.qml
diff options
context:
space:
mode:
authorTopi Reinio <topi.reinio@theqtcompany.com>2016-02-23 13:55:59 +0100
committerTopi Reiniƶ <topi.reinio@theqtcompany.com>2016-02-24 11:12:30 +0000
commit90e9b622f01465666f4ae3f88d1710a36bb2ed1f (patch)
tree924a7c09b5442a2954de8d6b494341af0db7c8dc /examples/quick/demos/stocqt/stocqt.qml
parentd3f8a608e8e00915df38a2a43496127a93b5bcaf (diff)
StocQt demo: Bugfixes and improvements
- Update the list of NASDAQ-100 companies - Add code for handling invalid entries (stock IDs) - Simplify top-level navigation logic. The app now opens in list view with no stock pre-selected. - Fix math for calculating change percentages Change-Id: I6aaab45f5a391f9636123c0ddca73656fab79916 Task-number: QTBUG-50651 Reviewed-by: Mika Salmela <mika.salmela@theqtcompany.com> Reviewed-by: Venugopal Shivashankar <venugopal.shivashankar@digia.com>
Diffstat (limited to 'examples/quick/demos/stocqt/stocqt.qml')
-rw-r--r--examples/quick/demos/stocqt/stocqt.qml11
1 files changed, 3 insertions, 8 deletions
diff --git a/examples/quick/demos/stocqt/stocqt.qml b/examples/quick/demos/stocqt/stocqt.qml
index 512d6e1073..6b1da1713a 100644
--- a/examples/quick/demos/stocqt/stocqt.qml
+++ b/examples/quick/demos/stocqt/stocqt.qml
@@ -47,7 +47,7 @@ Rectangle {
width: 1000
height: 700
- property int listViewActive: 0
+ property alias currentIndex: root.currentIndex
Rectangle {
id: banner
@@ -66,7 +66,7 @@ Rectangle {
MouseArea {
anchors.fill: parent
- onClicked: listViewActive = 1;
+ onClicked: root.currentIndex = 0;
}
}
@@ -108,11 +108,6 @@ Rectangle {
focus: false
orientation: ListView.Horizontal
boundsBehavior: Flickable.StopAtBounds
- currentIndex: listViewActive == 0 ? 1 : 0
- onCurrentIndexChanged: {
- if (currentIndex == 1)
- listViewActive = 0;
- }
StockModel {
id: stock
@@ -120,7 +115,7 @@ Rectangle {
stockName: listView.currentStockName
onStockIdChanged: stock.updateStock();
onDataReady: {
- root.positionViewAtIndex(1, ListView.SnapPosition)
+ root.currentIndex = 1
stockView.update()
}
}