diff options
author | Alexis Menard <alexis.menard@nokia.com> | 2010-04-14 05:48:40 (GMT) |
---|---|---|
committer | Alexis Menard <alexis.menard@nokia.com> | 2010-04-14 05:48:40 (GMT) |
commit | 2333ad8b4b93337c2515bc673b100c47b45e516b (patch) | |
tree | a338e4682dc857658824e7f07efe9ca57e4b9d0e /doc/src/snippets/declarative/codingconventions/javascript.qml | |
parent | c6483baf226e9e698983aa596761825ad4a8a698 (diff) | |
parent | 37581fa549c5cbe56afc68c71fa97d8f933512c0 (diff) | |
download | Qt-2333ad8b4b93337c2515bc673b100c47b45e516b.zip Qt-2333ad8b4b93337c2515bc673b100c47b45e516b.tar.gz Qt-2333ad8b4b93337c2515bc673b100c47b45e516b.tar.bz2 |
Merge branch '4.7' into reviews/2361
Conflicts:
src/declarative/graphicsitems/qdeclarativeitem.h
Diffstat (limited to 'doc/src/snippets/declarative/codingconventions/javascript.qml')
-rw-r--r-- | doc/src/snippets/declarative/codingconventions/javascript.qml | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/doc/src/snippets/declarative/codingconventions/javascript.qml b/doc/src/snippets/declarative/codingconventions/javascript.qml new file mode 100644 index 0000000..64b5a40 --- /dev/null +++ b/doc/src/snippets/declarative/codingconventions/javascript.qml @@ -0,0 +1,33 @@ +import Qt 4.7 + +Rectangle { + +//![0] +Rectangle { color: "blue"; width: parent.width / 3 } +//![0] + +//![1] +Rectangle { + color: "blue" + width: { + var w = parent.width / 3 + console.debug(w) + return w + } +} +//![1] + +//![2] +function calculateWidth(object) +{ + var w = object.width / 3 + // ... + // more javascript code + // ... + console.debug(w) + return w +} + +Rectangle { color: "blue"; width: calculateWidth(parent) } +//![2] +} |