aboutsummaryrefslogtreecommitdiffstats
path: root/examples/quick
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@theqtcompany.com>2015-08-18 10:29:10 +0200
committerUlf Hermann <ulf.hermann@theqtcompany.com>2015-08-18 10:29:47 +0200
commiteb30e3d7ee81c48cea720e7ecd2ed45647bc70ee (patch)
tree810e8ad0642434eeb4043c3a06c82217314300e1 /examples/quick
parent9c9fca5e27bd91da1ea07bebd7569049493c5ccf (diff)
parent521ace713d8e5230d47f3da8cd941699ca085af2 (diff)
Merge remote-tracking branch 'origin/5.5' into 5.6
Conflicts: src/qml/debugger/qv4debugservice.cpp src/qml/jsruntime/qv4value_inl_p.h src/qml/jsruntime/qv4value_p.h src/qml/memory/qv4mm.cpp src/qml/memory/qv4mm_p.h src/qml/qml/qqmlnotifier_p.h src/qml/qml/qqmlproperty.cpp src/quick/items/qquickflickable.cpp src/quick/items/qquicktextedit.cpp tests/auto/quick/qquickwindow/BLACKLIST The extra changes in qqmlbinding.cpp are ported from changes to qqmlproperty.cpp that occurred in parallel with writeBinding() being moved to qqmlbinding.cpp. Change-Id: I16d1920abf448c29a01822256f52153651a56356
Diffstat (limited to 'examples/quick')
-rw-r--r--examples/quick/canvas/squircle/squircle.qml4
-rw-r--r--examples/quick/demos/stocqt/content/StockInfo.qml126
-rw-r--r--examples/quick/demos/stocqt/content/StockListView.qml4
3 files changed, 67 insertions, 67 deletions
diff --git a/examples/quick/canvas/squircle/squircle.qml b/examples/quick/canvas/squircle/squircle.qml
index 7c62ef5d02..04c9df42d3 100644
--- a/examples/quick/canvas/squircle/squircle.qml
+++ b/examples/quick/canvas/squircle/squircle.qml
@@ -90,9 +90,9 @@ Item {
onFillChanged: requestPaint();
onStrokeChanged: requestPaint();
- onPaint: squcirle();
+ onPaint: squircle();
- function squcirle() {
+ function squircle() {
var ctx = canvas.getContext("2d");
var N = canvas.nSize;
var R = canvas.radius;
diff --git a/examples/quick/demos/stocqt/content/StockInfo.qml b/examples/quick/demos/stocqt/content/StockInfo.qml
index 337cc79f70..50f6b9107e 100644
--- a/examples/quick/demos/stocqt/content/StockInfo.qml
+++ b/examples/quick/demos/stocqt/content/StockInfo.qml
@@ -48,72 +48,72 @@ Rectangle {
property var stock: null
- Text {
- id: stockIdText
- anchors.left: parent.left
- anchors.leftMargin: 5
- anchors.top: parent.top
- anchors.topMargin: 15
- color: "#000000"
- font.family: "Open Sans"
- font.pointSize: 38
- font.weight: Font.DemiBold
- text: root.stock.stockId
- }
+ Column {
+ id: stockColumn
+ anchors.fill: parent
+ spacing: 4
- Text {
- id: stockNameText
- anchors.left: parent.left
- anchors.leftMargin: 5
- anchors.bottom: priceChangePercentage.bottom
- anchors.right: priceChangePercentage.left
- anchors.rightMargin: 15
- color: "#000000"
- font.family: "Open Sans"
- font.pointSize: 16
- elide: Text.ElideRight
- text: root.stock.stockName
- }
+ Flow {
+ anchors { left: parent.left; right: parent.right }
+ spacing: 12
- Text {
- id: price
- anchors.right: parent.right
- anchors.rightMargin: 5
- anchors.top: parent.top
- anchors.topMargin: 15
- horizontalAlignment: Text.AlignRight
- color: "#000000"
- font.family: "Open Sans"
- font.pointSize: 30
- font.weight: Font.DemiBold
- text: root.stock.stockPrice
- }
+ Text {
+ id: stockIdText
+ color: "#000000"
+ font.family: "Open Sans"
+ font.pointSize: 28
+ font.weight: Font.DemiBold
+ text: root.stock.stockId
+ }
- Text {
- id: priceChange
- anchors.right: parent.right
- anchors.rightMargin: 20
- anchors.top: price.bottom
- anchors.topMargin: 5
- horizontalAlignment: Text.AlignRight
- color: root.stock.stockPriceChanged < 0 ? "#d40000" : "#328930"
- font.family: "Open Sans"
- font.pointSize: 20
- font.weight: Font.Bold
- text: root.stock.stockPriceChanged
- }
+ Text {
+ id: price
+ color: "#6d6d6d"
+ font.family: "Open Sans"
+ font.pointSize: 28
+ font.weight: Font.DemiBold
+ text: parseFloat(Math.round(root.stock.stockPrice * 100) / 100).toFixed(2);
+ }
+ }
+
+ Text {
+ id: stockNameText
+ color: "#0c0c0c"
+ font.family: "Open Sans"
+ font.pointSize: 16
+ width: stockColumn.width
+ elide: Text.ElideRight
+ maximumLineCount: 3
+ wrapMode: Text.WordWrap
+ text: root.stock.stockName
+ }
+
+ Flow {
+ anchors { left: parent.left; right: parent.right }
+ spacing: 12
+
+ Text {
+ id: priceChange
+ horizontalAlignment: Text.AlignRight
+ color: root.stock.stockPriceChanged < 0 ? "#d40000" : "#328930"
+ font.family: "Open Sans"
+ font.pointSize: 18
+ text: parseFloat(Math.round(root.stock.stockPriceChanged * 100) / 100).toFixed(2);
+ }
- Text {
- id: priceChangePercentage
- anchors.right: parent.right
- anchors.rightMargin: 20
- anchors.top: priceChange.bottom
- anchors.topMargin: 5
- horizontalAlignment: Text.AlignRight
- color: root.stock.stockPriceChanged < 0 ? "#d40000" : "#328930"
- font.family: "Open Sans"
- font.pointSize: 18
- font.weight: Font.Bold
- text: Math.abs(Math.round(root.stock.stockPriceChanged/(root.stock.stockPrice - root.stock.stockPriceChanged) * 100))/100 +"%"
+ Text {
+ id: priceChangePercentage
+ horizontalAlignment: Text.AlignRight
+ color: root.stock.stockPriceChanged < 0 ? "#d40000" : "#328930"
+ font.family: "Open Sans"
+ font.pointSize: 18
+ font.weight: Font.DemiBold
+ text: "(" +
+ Math.abs(Math.round(
+ root.stock.stockPriceChanged /
+ (root.stock.stockPrice - root.stock.stockPriceChanged) * 100)) / 100 +
+ "%)"
+ }
+ }
}
}
diff --git a/examples/quick/demos/stocqt/content/StockListView.qml b/examples/quick/demos/stocqt/content/StockListView.qml
index 53e345db59..470531a21e 100644
--- a/examples/quick/demos/stocqt/content/StockListView.qml
+++ b/examples/quick/demos/stocqt/content/StockListView.qml
@@ -96,9 +96,9 @@ Rectangle {
var records = xhr.responseText.split('\n');
if (records.length > 0) {
var r = records[1].split(',');
- model.setProperty(index, "value", r[4]);
-
var today = parseFloat(r[4]);
+ model.setProperty(index, "value", today.toFixed(2));
+
r = records[2].split(',');
var yesterday = parseFloat(r[4]);
var change = today - yesterday;