diff options
author | Jens Bache-Wiig <jens.bache-wiig@digia.com> | 2012-12-13 19:16:13 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2012-12-13 20:43:59 +0100 |
commit | 93c7cf2cbc650d1590037d86f8eba6d0be029159 (patch) | |
tree | e54a77727f885789222b3b6588b2015862a3f559 /examples/quick/demos/stocqt/content/StockListView.qml | |
parent | 47d97fe72bff0bfd4e2a32ecb7850502cf0a82d5 (diff) |
Clean up the StockQt demo
I cleaned up the whitespace, property declarations and removed
some console output. No changes to the functionality or design.
Change-Id: I499f6d061e43bf2e187eebc026858b3abd21a9b0
Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
Reviewed-by: Alan Alpert <aalpert@rim.com>
Diffstat (limited to 'examples/quick/demos/stocqt/content/StockListView.qml')
-rw-r--r-- | examples/quick/demos/stocqt/content/StockListView.qml | 78 |
1 files changed, 41 insertions, 37 deletions
diff --git a/examples/quick/demos/stocqt/content/StockListView.qml b/examples/quick/demos/stocqt/content/StockListView.qml index c241efb54c..f4ac6cb1a2 100644 --- a/examples/quick/demos/stocqt/content/StockListView.qml +++ b/examples/quick/demos/stocqt/content/StockListView.qml @@ -41,47 +41,51 @@ import QtQuick 2.0 Rectangle { - id:root - width:320 - height:480 - color:"#423A2F" + id: root + width: 320 + height: 480 + color: "#423A2F" - property string currentStockId:"" - property string currentStockName:"" + property string currentStockId: "" + property string currentStockName: "" - ListView { - id:view - anchors.fill:parent - keyNavigationWraps:true - focus:true - snapMode: ListView.SnapToItem - model:StockListModel{} + ListView { + id: view + anchors.fill: parent + keyNavigationWraps: true + focus: true + snapMode: ListView.SnapToItem + model: StockListModel{} - onCurrentIndexChanged: { - root.currentStockId = model.get(currentIndex).stockId - root.currentStockName = model.get(currentIndex).name - console.log("current stock:" + root.currentStockId + " - " + root.currentStockName) - } + onCurrentIndexChanged: { + root.currentStockId = model.get(currentIndex).stockId; + root.currentStockName = model.get(currentIndex).name; + console.log("current stock:" + root.currentStockId + " - " + root.currentStockName); + } - delegate:Rectangle { - height:30 - width:parent.width - color:"transparent" - MouseArea { - anchors.fill: parent - onClicked:view.currentIndex = index - } + delegate: Rectangle { + height: 30 + width: parent.width + color: "transparent" + MouseArea { + anchors.fill: parent; + onClicked:view.currentIndex = index; + } - Text { - anchors.verticalCenter : parent.top - anchors.verticalCenterOffset : 15 - color:index == view.currentIndex ? "#ECC089" : "#A58963" - font.pointSize:12 - font.bold:true - text:" " + stockId + " - " + name + Text { + anchors.verticalCenter: parent.top + anchors.verticalCenterOffset : 15 + color: index == view.currentIndex ? "#ECC089" : "#A58963" + font.pointSize: 12 + font.bold: true + text:" " + stockId + " - " + name + } } - } - highlight:Image {height:30; width:parent.width; source:"images/stock-selected.png"} - } -}
\ No newline at end of file + highlight: Image { + height:30 + width:parent.width + source:"images/stock-selected.png" + } + } +} |