diff options
author | Bea Lam <bea.lam@nokia.com> | 2010-04-23 06:42:16 (GMT) |
---|---|---|
committer | Bea Lam <bea.lam@nokia.com> | 2010-04-23 07:18:58 (GMT) |
commit | 3a5040ebacb177e883e2f79660194c1034fa79c2 (patch) | |
tree | cc0a943b7758052d6d2959f55b19adf8c046d32c /examples/declarative/tutorials/extending/chapter3-bindings/app.qml | |
parent | 80d1bc3da3ac03deb321a307a87df1f5f331e48f (diff) | |
download | Qt-3a5040ebacb177e883e2f79660194c1034fa79c2.zip Qt-3a5040ebacb177e883e2f79660194c1034fa79c2.tar.gz Qt-3a5040ebacb177e883e2f79660194c1034fa79c2.tar.bz2 |
Add tutorial for writing QML extensions
Diffstat (limited to 'examples/declarative/tutorials/extending/chapter3-bindings/app.qml')
-rw-r--r-- | examples/declarative/tutorials/extending/chapter3-bindings/app.qml | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/examples/declarative/tutorials/extending/chapter3-bindings/app.qml b/examples/declarative/tutorials/extending/chapter3-bindings/app.qml new file mode 100644 index 0000000..0460b0b --- /dev/null +++ b/examples/declarative/tutorials/extending/chapter3-bindings/app.qml @@ -0,0 +1,31 @@ +import Music 1.0 +import Qt 4.7 + +Rectangle { + width: 200; height: 200 + + Musician { + id: reddy + name: "Reddy the Rocker" + instrument: "Guitar" + } + + Musician { + id: craig + name: "Craig the Copycat" + instrument: reddy.instrument + } + + MouseArea { + anchors.fill: parent + onClicked: { + reddy.perform() + craig.perform() + + reddy.instrument = "Drums" + + reddy.perform() + craig.perform() + } + } +} |