summaryrefslogtreecommitdiffstats
path: root/demos/declarative/calculator
diff options
context:
space:
mode:
authorYann Bodson <yann.bodson@nokia.com>2010-04-15 09:03:12 (GMT)
committerYann Bodson <yann.bodson@nokia.com>2010-04-15 09:03:12 (GMT)
commit8dca45fa2ad0f260143282ee01d52e72f8f88a68 (patch)
tree754a6384b0881210d02ea89751127911849670c0 /demos/declarative/calculator
parent0e0009e0bae445938e73e3ea7b031c882b8930d2 (diff)
downloadQt-8dca45fa2ad0f260143282ee01d52e72f8f88a68.zip
Qt-8dca45fa2ad0f260143282ee01d52e72f8f88a68.tar.gz
Qt-8dca45fa2ad0f260143282ee01d52e72f8f88a68.tar.bz2
Small calculator fix.
Diffstat (limited to 'demos/declarative/calculator')
-rw-r--r--demos/declarative/calculator/Core/calculator.js2
-rw-r--r--demos/declarative/calculator/calculator.qml18
2 files changed, 10 insertions, 10 deletions
diff --git a/demos/declarative/calculator/Core/calculator.js b/demos/declarative/calculator/Core/calculator.js
index 2b19de8..51b3dd3 100644
--- a/demos/declarative/calculator/Core/calculator.js
+++ b/demos/declarative/calculator/Core/calculator.js
@@ -54,7 +54,7 @@ function doOperation(op) {
if (op == "1/x") {
display.text = (1 / display.text.valueOf()).toString()
- } else if (op == "^2") {
+ } else if (op == "x^2") {
display.text = (display.text.valueOf() * display.text.valueOf()).toString()
} else if (op == "Abs") {
display.text = (Math.abs(display.text.valueOf())).toString()
diff --git a/demos/declarative/calculator/calculator.qml b/demos/declarative/calculator/calculator.qml
index fc2b95a..286a4d1 100644
--- a/demos/declarative/calculator/calculator.qml
+++ b/demos/declarative/calculator/calculator.qml
@@ -36,28 +36,28 @@ Rectangle {
id: column; spacing: 6
property real h: ((box.height - 72) / 6) - ((spacing * (6 - 1)) / 6)
+ property real w: (box.width / 4) - ((spacing * (4 - 1)) / 4)
Row {
spacing: 6
- property real w: (box.width / 4) - ((spacing * (4 - 1)) / 4)
Button {
id: rotateButton
- width: parent.w; height: column.h; color: 'purple'; operation: rotateLeft
+ width: column.w; height: column.h; color: 'purple'; operation: rotateLeft
}
- Button { width: parent.w; height: column.h; color: 'purple'; operation: leftArrow }
- Button { width: parent.w; height: column.h; color: 'purple'; operation: "C" }
- Button { width: parent.w; height: column.h; color: 'purple'; operation: "AC" }
+ Button { width: column.w; height: column.h; color: 'purple'; operation: leftArrow }
+ Button { width: column.w; height: column.h; color: 'purple'; operation: "C" }
+ Button { width: column.w; height: column.h; color: 'purple'; operation: "AC" }
}
Row {
spacing: 6
property real w: (box.width / 4) - ((spacing * (4 - 1)) / 4)
- Button { width: parent.w; height: column.h; color: 'green'; operation: "mc" }
- Button { width: parent.w; height: column.h; color: 'green'; operation: "m+" }
- Button { width: parent.w; height: column.h; color: 'green'; operation: "m-" }
- Button { width: parent.w; height: column.h; color: 'green'; operation: "mr" }
+ Button { width: column.w; height: column.h; color: 'green'; operation: "mc" }
+ Button { width: column.w; height: column.h; color: 'green'; operation: "m+" }
+ Button { width: column.w; height: column.h; color: 'green'; operation: "m-" }
+ Button { width: column.w; height: column.h; color: 'green'; operation: "mr" }
}
Grid {