summaryrefslogtreecommitdiff
path: root/demos/declarative/calculator
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2010-03-22 15:34:41 +1000
committerAaron Kennedy <aaron.kennedy@nokia.com>2010-03-22 15:36:35 +1000
commit888d29c9c138ca3d698985f090ceb3db912ade0f (patch)
treeaa991f683dd8e7ea4b05d029dd75b32321fde3c0 /demos/declarative/calculator
parent42de973ff156383beed62a6b1bce70b56b360078 (diff)
downloadqt4-tools-888d29c9c138ca3d698985f090ceb3db912ade0f.tar.gz
Deprecate inline Script {} blocks
Inline blocks/includes have been replaced with an import syntax: import "foo.js" as Foo this gives better separation between QML and code. Imported script blocks also have a mandatory qualifier, which leads to better optimization potential.
Diffstat (limited to 'demos/declarative/calculator')
-rw-r--r--demos/declarative/calculator/calculator.js2
-rw-r--r--demos/declarative/calculator/calculator.qml4
2 files changed, 4 insertions, 2 deletions
diff --git a/demos/declarative/calculator/calculator.js b/demos/declarative/calculator/calculator.js
index cd6490a3a4..f172daf01b 100644
--- a/demos/declarative/calculator/calculator.js
+++ b/demos/declarative/calculator/calculator.js
@@ -14,7 +14,7 @@ function disabled(op) {
}
}
-function doOp(op) {
+function doOperation(op) {
if (disabled(op)) {
return;
}
diff --git a/demos/declarative/calculator/calculator.qml b/demos/declarative/calculator/calculator.qml
index 66705e271c..16449688af 100644
--- a/demos/declarative/calculator/calculator.qml
+++ b/demos/declarative/calculator/calculator.qml
@@ -1,10 +1,12 @@
import Qt 4.6
+import "calculator.js" as CalcEngine
Rectangle {
width: 320; height: 270; color: palette.window
+ function doOp(operation) { CalcEngine.doOperation(operation); }
+
SystemPalette { id: palette }
- Script { source: "calculator.js" }
Column {
x: 2; spacing: 10;