Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add docs for PaintedItem examples
No launcher, because they're C++ examples

Change-Id: Icff2ad31c65d5a878c3818d54ed81cf0d6aa664b
Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
  • Loading branch information
Alan Alpert authored and Qt by Nokia committed Mar 20, 2012
1 parent 8e8738d commit 738d3a9
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 84 deletions.
110 changes: 29 additions & 81 deletions examples/quick/painteditem/smile/smile.qml
Expand Up @@ -40,93 +40,41 @@

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()
}
}
}
}
}
11 changes: 8 additions & 3 deletions examples/quick/painteditem/textballoons/textballoons.qml
Expand Up @@ -42,9 +42,14 @@
import QtQuick 2.0
import TextBalloonPlugin 1.0

/*!
\title QtQuick Examples - Painted Text Balloons
\example quick/painteditem/textballoons
\brief This is a simple example that draws text balloons using QPainter
*/
Item {
height: 480
width: 640
width: 320

//! [0]
ListModel {
Expand All @@ -53,7 +58,7 @@ Item {
balloonWidth: 200
}
ListElement {
balloonWidth: 350
balloonWidth: 120
}
}

Expand Down Expand Up @@ -95,7 +100,7 @@ Item {
anchors.fill: parent
hoverEnabled: true
onClicked: {
balloonModel.append({"balloonWidth": Math.floor(Math.random() * 300 + 100)})
balloonModel.append({"balloonWidth": Math.floor(Math.random() * 200 + 100)})
balloonView.positionViewAtIndex(balloonView.count -1, ListView.End)
}
onEntered: {
Expand Down

0 comments on commit 738d3a9

Please sign in to comment.