examples/declarative/tutorials/extending/chapter2-methods/app.qml
changeset 33 3e2da88830cd
parent 30 5dc02b23752f
--- a/examples/declarative/tutorials/extending/chapter2-methods/app.qml	Tue Jul 06 15:10:48 2010 +0300
+++ b/examples/declarative/tutorials/extending/chapter2-methods/app.qml	Wed Aug 18 10:37:55 2010 +0300
@@ -37,23 +37,30 @@
 ** $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
 
-    Musician {
-        id: aMusician
-        name: "Reddy the Rocker"
-        instrument: "Guitar"
+    PieChart {
+        id: aPieChart
+        anchors.centerIn: parent
+        width: 100; height: 100
+        color: "red"
 
-        onPerformanceEnded: console.log("The performance has now ended")
+        onChartCleared: console.log("The chart has been cleared")
     }
 
     MouseArea {
         anchors.fill: parent
-        onClicked: aMusician.perform()
+        onClicked: aPieChart.clearChart()
+    }
+
+    Text {
+        anchors { bottom: parent.bottom; horizontalCenter: parent.horizontalCenter; bottomMargin: 20 }
+        text: "Click anywhere to clear the chart"
     }
 }
+//![0]