diff options
| author | Alan Alpert <alan.alpert@nokia.com> | 2010-04-12 07:38:46 (GMT) | 
|---|---|---|
| committer | Alan Alpert <alan.alpert@nokia.com> | 2010-04-12 07:38:46 (GMT) | 
| commit | ee958684bd1273a5140e1f6d1264bf8bb7d62ef1 (patch) | |
| tree | c3b95bb906483b14dd9a58098b18b82b9d9010c2 /doc/src/snippets/declarative/codingconventions/javascript.qml | |
| parent | efc80209fb5e6ac9d0343b3c9f6d5a1548cf5556 (diff) | |
| parent | 9753f6098e0e5b3d80ac748559aecc2e66dcfc7a (diff) | |
| download | Qt-ee958684bd1273a5140e1f6d1264bf8bb7d62ef1.zip Qt-ee958684bd1273a5140e1f6d1264bf8bb7d62ef1.tar.gz Qt-ee958684bd1273a5140e1f6d1264bf8bb7d62ef1.tar.bz2 | |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-qml into 4.7
Conflicts:
	src/declarative/graphicsitems/qdeclarativetextinput.cpp
	src/declarative/graphicsitems/qdeclarativetextinput_p.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] +} | 
