summaryrefslogtreecommitdiff
path: root/doc/src/snippets/qml/codingconventions/myscript.js
diff options
context:
space:
mode:
Diffstat (limited to 'doc/src/snippets/qml/codingconventions/myscript.js')
-rw-r--r--doc/src/snippets/qml/codingconventions/myscript.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/doc/src/snippets/qml/codingconventions/myscript.js b/doc/src/snippets/qml/codingconventions/myscript.js
new file mode 100644
index 0000000000..e7f83c259c
--- /dev/null
+++ b/doc/src/snippets/qml/codingconventions/myscript.js
@@ -0,0 +1,12 @@
+function calculateWidth(parent)
+{
+ if (parent == null)
+ return 0
+
+ var w = parent.width / 3
+ // ...
+ // more javascript code
+ // ...
+ console.debug(w)
+ return w
+}