summaryrefslogtreecommitdiffstats
path: root/examples/declarative/tutorials/extending/chapter3-bindings/app.qml
diff options
context:
space:
mode:
authorBea Lam <bea.lam@nokia.com>2010-04-23 06:42:16 (GMT)
committerBea Lam <bea.lam@nokia.com>2010-04-23 07:18:58 (GMT)
commit3a5040ebacb177e883e2f79660194c1034fa79c2 (patch)
treecc0a943b7758052d6d2959f55b19adf8c046d32c /examples/declarative/tutorials/extending/chapter3-bindings/app.qml
parent80d1bc3da3ac03deb321a307a87df1f5f331e48f (diff)
downloadQt-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.qml31
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()
+ }
+ }
+}