aboutsummaryrefslogtreecommitdiffstats
path: root/examples/declarative/painteditem/smile/smile.qml
diff options
context:
space:
mode:
Diffstat (limited to 'examples/declarative/painteditem/smile/smile.qml')
-rw-r--r--examples/declarative/painteditem/smile/smile.qml83
1 files changed, 79 insertions, 4 deletions
diff --git a/examples/declarative/painteditem/smile/smile.qml b/examples/declarative/painteditem/smile/smile.qml
index bc4bd2664b..e09d9b1fa8 100644
--- a/examples/declarative/painteditem/smile/smile.qml
+++ b/examples/declarative/painteditem/smile/smile.qml
@@ -42,16 +42,91 @@ import QtQuick 2.0
import MyModule 1.0
Rectangle {
- width: 480
- height: 480
+ width: 500
+ height: 500
gradient: Gradient {
GradientStop { position: 0.0; color: "#00249a" }
GradientStop { position: 0.7; color: "#ffd94f" }
GradientStop { position: 1.0; color: "#ffa322" }
}
MyPaintItem {
- anchors.fill: parent
+ 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()
+ }
+ }
}
-}
+ 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