--- a/examples/declarative/tutorials/extending/chapter3-bindings/app.qml Tue Jul 06 15:10:48 2010 +0300
+++ b/examples/declarative/tutorials/extending/chapter3-bindings/app.qml Wed Aug 18 10:37:55 2010 +0300
@@ -37,35 +37,38 @@
** $QT_END_LICENSE$
**
****************************************************************************/
-
-import Music 1.0
+//![0]
+import Charts 1.0
import Qt 4.7
-Rectangle {
- width: 200; height: 200
+Item {
+ width: 300; height: 200
+
+ Row {
+ anchors.centerIn: parent
+ spacing: 20
- Musician {
- id: reddy
- name: "Reddy the Rocker"
- instrument: "Guitar"
- }
+ PieChart {
+ id: chartA
+ width: 100; height: 100
+ color: "red"
+ }
- Musician {
- id: craig
- name: "Craig the Copycat"
- instrument: reddy.instrument
+ PieChart {
+ id: chartB
+ width: 100; height: 100
+ color: chartA.color
+ }
}
MouseArea {
anchors.fill: parent
- onClicked: {
- reddy.perform()
- craig.perform()
+ onClicked: { chartA.color = "blue" }
+ }
- reddy.instrument = "Drums"
-
- reddy.perform()
- craig.perform()
- }
+ Text {
+ anchors { bottom: parent.bottom; horizontalCenter: parent.horizontalCenter; bottomMargin: 20 }
+ text: "Click anywhere to change the chart color"
}
}
+//![0]