aboutsummaryrefslogtreecommitdiffstats
path: root/examples/quick/demos/stocqt/content/StockView.qml
diff options
context:
space:
mode:
authorJens Bache-Wiig <jens.bache-wiig@digia.com>2012-12-13 19:16:13 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2012-12-13 20:43:59 +0100
commit93c7cf2cbc650d1590037d86f8eba6d0be029159 (patch)
treee54a77727f885789222b3b6588b2015862a3f559 /examples/quick/demos/stocqt/content/StockView.qml
parent47d97fe72bff0bfd4e2a32ecb7850502cf0a82d5 (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/StockView.qml')
-rw-r--r--examples/quick/demos/stocqt/content/StockView.qml158
1 files changed, 80 insertions, 78 deletions
diff --git a/examples/quick/demos/stocqt/content/StockView.qml b/examples/quick/demos/stocqt/content/StockView.qml
index 49e6c98622..308ecc0535 100644
--- a/examples/quick/demos/stocqt/content/StockView.qml
+++ b/examples/quick/demos/stocqt/content/StockView.qml
@@ -39,91 +39,93 @@
****************************************************************************/
import QtQuick 2.0
-Rectangle {
- id:root
- width:320
- height:480
- color:"#423A2F"
- property var stock:null
- property var stocklist:null
- property var settings:null
- signal listViewClicked
- signal settingsClicked
- function update() {
- chart.endDate = settings.endDate
- chart.update()
- }
+Rectangle {
+ id: root
+ width: 320
+ height: 480
+ color: "#423A2F"
- Rectangle {
- color:"#272822"
- anchors.fill:parent
- radius:20
+ property var stock: null
+ property var stocklist: null
+ property var settings: null
+ signal listViewClicked
+ signal settingsClicked
- Image {
- source:"images/icon-items.png"
- anchors.left:parent.left
- anchors.leftMargin:10
- anchors.top:parent.top
- anchors.topMargin:10
- MouseArea {
- anchors.fill:parent
- onClicked:listViewClicked()
- }
- }
- Image {
- source:"images/icon-settings.png"
- anchors.right:parent.right
- anchors.rightMargin:10
- anchors.top:parent.top
- anchors.topMargin:10
- MouseArea {
- anchors.fill:parent
- onClicked:settingsClicked()
- }
+ function update() {
+ chart.endDate = settings.endDate
+ chart.update()
}
- Text {
- id:desc
- anchors.left:parent.left
- anchors.leftMargin:20
- anchors.top:parent.top
- anchors.topMargin:40
- color:"#564c3A"
- font.pointSize:15
- text:root.stock.stockId + " - " + root.stock.stockName
- }
+ Rectangle {
+ color: "#272822"
+ anchors.fill: parent
+ radius: 20
- Text {
- id:price
- anchors.left:parent.left
- anchors.leftMargin:20
- anchors.top:desc.bottom
- anchors.topMargin:5
- color:"#ECC089"
- font.pointSize:30
- text:root.stock.stockPrice
- }
+ Image {
+ source: "images/icon-items.png"
+ anchors.left: parent.left
+ anchors.leftMargin: 10
+ anchors.top: parent.top
+ anchors.topMargin: 10
+ MouseArea {
+ anchors.fill: parent
+ onClicked: listViewClicked()
+ }
+ }
+ Image {
+ source: "images/icon-settings.png"
+ anchors.right: parent.right
+ anchors.rightMargin: 10
+ anchors.top: parent.top
+ anchors.topMargin: 10
+ MouseArea {
+ anchors.fill: parent
+ onClicked: settingsClicked()
+ }
+ }
- Text {
- id:priceChange
- anchors.left:parent.left
- anchors.leftMargin:20
- anchors.top:price.bottom
- anchors.topMargin:5
- color: root.stock.stockPriceChanged < 0 ? "#A43D3D" : "#679B3A"
- font.pointSize:25
- text: root.stock.stockPriceChanged + " (" + Math.abs(Math.round(root.stock.stockPriceChanged/(root.stock.stockPrice - root.stock.stockPriceChanged) * 100))/100 +"%)"
- }
+ Text {
+ id: desc
+ anchors.left: parent.left
+ anchors.leftMargin: 20
+ anchors.top: parent.top
+ anchors.topMargin: 40
+ color: "#564c3A"
+ font.pointSize: 15
+ text: root.stock.stockId + " - " + root.stock.stockName
+ }
+
+ Text {
+ id: price
+ anchors.left: parent.left
+ anchors.leftMargin: 20
+ anchors.top: desc.bottom
+ anchors.topMargin: 5
+ color: "#ECC089"
+ font.pointSize: 30
+ text: root.stock.stockPrice
+ }
+
+ Text {
+ id: priceChange
+ anchors.left: parent.left
+ anchors.leftMargin: 20
+ anchors.top: price.bottom
+ anchors.topMargin: 5
+ color: root.stock.stockPriceChanged < 0 ? "#A43D3D" : "#679B3A"
+ font.pointSize: 25
+ text: root.stock.stockPriceChanged + " (" + Math.abs(Math.round(root.stock.stockPriceChanged/(root.stock.stockPrice - root.stock.stockPriceChanged) * 100))/100 +"%)"
+ }
- StockChart {
- id:chart
- anchors.bottom: parent.bottom
- anchors.top : priceChange.bottom
- anchors.topMargin: 30
- width:parent.width
- stockModel:root.stock
- settings:root.settings
+ StockChart {
+ id: chart
+ anchors.bottom: parent.bottom
+ anchors.top : priceChange.bottom
+ anchors.topMargin: 30
+ width: parent.width
+ stockModel: root.stock
+ settings: root.settings
+ }
}
- }
}