From 93c7cf2cbc650d1590037d86f8eba6d0be029159 Mon Sep 17 00:00:00 2001 From: Jens Bache-Wiig Date: Thu, 13 Dec 2012 19:16:13 +0100 Subject: 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 Reviewed-by: Alan Alpert --- .../quick/demos/stocqt/content/StockListView.qml | 78 ++++++++++++---------- 1 file changed, 41 insertions(+), 37 deletions(-) (limited to 'examples/quick/demos/stocqt/content/StockListView.qml') 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" + } + } +} -- cgit v1.2.3