diff options
author | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com> | 2010-04-19 08:45:09 (GMT) |
---|---|---|
committer | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com> | 2010-04-19 08:45:09 (GMT) |
commit | 0bbf0c7c189e3a3fd7860aae86d2f62d4bc77014 (patch) | |
tree | f9b0b9e50f70b8f24e29c1966ebd23ffa3377a40 /doc/src/snippets/declarative/codingconventions/javascript.qml | |
parent | bce9c47d5437812b137c47ff3c602ff23ffa5e22 (diff) | |
parent | 5ce428cf7f20cd37f4cf0d92ddcceddd07c5a0db (diff) | |
download | Qt-0bbf0c7c189e3a3fd7860aae86d2f62d4bc77014.zip Qt-0bbf0c7c189e3a3fd7860aae86d2f62d4bc77014.tar.gz Qt-0bbf0c7c189e3a3fd7860aae86d2f62d4bc77014.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into 4.7
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] +} |