summaryrefslogtreecommitdiffstats
path: root/examples/declarative/tutorials/extending/chapter3-bindings/app.qml
blob: 0460b0b318a99fc77104438a6ebde6346bf618af (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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()
        }
    }
}