Add docs for PaintedItem examples
[profile/ivi/qtdeclarative.git] / examples / quick / painteditem / smile / smile.qml
index 33919bc..c30da1b 100644 (file)
 
 import QtQuick 2.0
 import MyModule 1.0
+/*!
+    \title QtQuick Examples - Painted Smile
+    \example quick/painteditem/smile
+    \brief This is a simple example the draws a smile with QPainter
+*/
 
 Rectangle {
-    width: 500
-    height: 500
+    width: 320
+    height: 480
     gradient: Gradient {
         GradientStop { position: 0.0; color: "#00249a" }
         GradientStop { position: 0.7; color: "#ffd94f" }
         GradientStop { position: 1.0; color: "#ffa322" }
     }
-    MyPaintItem {
-        renderTarget:PaintedItem.Image
-        clip:true
-        width:240
-        height:240
-        anchors.left : parent.left
-        anchors.top :parent.top
-        anchors.margins: 10
-        smooth: true
-        MouseArea {
-          anchors.fill:parent
-          onClicked: {
-           if (parent.face == ":-)")
-              parent.face = ":-(";
-           else
-              parent.face = ":-)";
-           parent.update()
-          }
+    Grid {
+        columns: 2
+        Repeater {
+            model: 6
+            delegate: MyPaintItem {
+                renderTarget:PaintedItem.Image
+                clip:true
+                width:160
+                height:160
+                smooth: true
+                MouseArea {
+                  anchors.fill:parent
+                  onClicked: {
+                   if (parent.face == ":-)")
+                      parent.face = ":-(";
+                   else
+                      parent.face = ":-)";
+                   parent.update()
+                  }
+                }
+            }
         }
     }
-    MyPaintItem {
-        clip:true
-        renderTarget:PaintedItem.Image
-        width:240
-        height:240
-        anchors.right : parent.right
-        anchors.top :parent.top
-        anchors.margins: 10
-        smooth: true
-        MouseArea {
-          anchors.fill:parent
-          onClicked: {
-           if (parent.face == ":-)")
-              parent.face = ":-(";
-           else
-              parent.face = ":-)";
-           parent.update()
-          }
-        }
-    }
-    MyPaintItem {
-        clip:true
-        renderTarget:PaintedItem.Image
-        width:240
-        height:240
-        anchors.left : parent.left
-        anchors.bottom :parent.bottom
-        anchors.margins: 10
-        smooth: true
-        MouseArea {
-          anchors.fill:parent
-          onClicked: {
-           if (parent.face == ":-)")
-              parent.face = ":-(";
-           else
-              parent.face = ":-)";
-           parent.update()
-          }
-        }
-    }
-    MyPaintItem {
-        clip:true
-        renderTarget:PaintedItem.Image
-        width:240
-        height:240
-        anchors.right : parent.right
-        anchors.bottom :parent.bottom
-        anchors.margins: 10
-        smooth: true
-        MouseArea {
-          anchors.fill:parent
-          onClicked: {
-           if (parent.face == ":-)")
-              parent.face = ":-(";
-           else
-              parent.face = ":-)";
-           parent.update()
-          }
-        }
-    }
-}
\ No newline at end of file
+}