summaryrefslogtreecommitdiffstats
path: root/examples/declarative
diff options
context:
space:
mode:
Diffstat (limited to 'examples/declarative')
-rw-r--r--examples/declarative/animations/color-animation.qml5
-rw-r--r--examples/declarative/effects/effects.qml75
2 files changed, 13 insertions, 67 deletions
diff --git a/examples/declarative/animations/color-animation.qml b/examples/declarative/animations/color-animation.qml
index edb0659..54608c7 100644
--- a/examples/declarative/animations/color-animation.qml
+++ b/examples/declarative/animations/color-animation.qml
@@ -31,10 +31,7 @@ Item {
Item {
width: parent.width; height: 2 * parent.height
transformOrigin: Item.Center
- rotation: SequentialAnimation {
- running: true; repeat: true
- NumberAnimation { from: 0; to: 360; duration: 10000 }
- }
+ rotation: NumberAnimation { from: 0; to: 360; duration: 10000; running: true; repeat: true }
Image {
source: "images/sun.png"; y: 10; anchors.horizontalCenter: parent.horizontalCenter
transformOrigin: Item.Center; rotation: -3 * parent.rotation
diff --git a/examples/declarative/effects/effects.qml b/examples/declarative/effects/effects.qml
index 851b2fe..e6efc75 100644
--- a/examples/declarative/effects/effects.qml
+++ b/examples/declarative/effects/effects.qml
@@ -2,11 +2,12 @@ import Qt 4.6
Rectangle {
color: "white"
- width: 600
- height: 600
+ width: 400
+ height: 200
Image {
id: blur
+ x: 5
source: "pic.png"
effect: Blur {
@@ -24,49 +25,9 @@ Rectangle {
Text { text: "Blur"; anchors.top: blur.bottom; anchors.horizontalCenter: blur.horizontalCenter }
Image {
- id: grayscale
- source: "pic.png"
- x: 200
-
- effect: Grayscale {}
- }
-
- Text { text: "Grayscale"; anchors.top: grayscale.bottom; anchors.horizontalCenter: grayscale.horizontalCenter }
-
- Image {
- id: colorize
- source: "pic.png"
- x: 400
-
- effect: Colorize { color: "blue" }
- }
-
- Text { text: "Colorize"; anchors.top: colorize.bottom; anchors.horizontalCenter: colorize.horizontalCenter }
-
- Image {
- id: pixelize
- source: "pic.png"
- y: 300
-
- effect: Pixelize {
- pixelSize: NumberAnimation {
- id: pixelizeEffect
- from: 0; to: 10
- duration: 1000
- repeat: true
- }
- }
-
- MouseRegion { anchors.fill: parent; onClicked: pixelizeEffect.running = !pixelizeEffect.running }
- }
-
- Text { text: "Pixelize"; anchors.top: pixelize.bottom; anchors.horizontalCenter: pixelize.horizontalCenter }
-
- Image {
id: dropShadow
source: "pic.png"
- x: 200
- y: 300
+ x: 135
effect: DropShadow {
blurRadius: 3
@@ -77,33 +38,21 @@ Rectangle {
MouseRegion { anchors.fill: parent; onClicked: dropShadowEffect.running = !dropShadowEffect.running }
}
- Text { text: "Drop Shadow"; anchors.top: dropShadow.bottom; anchors.horizontalCenter: dropShadow.horizontalCenter }
-
Image {
- id: bloom
+ id: colorize
source: "pic.png"
- x: 400
- y: 300
+ x: 265
- effect: Bloom {
- blurRadius: 3
- brightness: 128
- strength: NumberAnimation {
- id: bloomEffect
- from: 0; to: 1
- duration: 1000
- repeat: true
- }
- }
-
- MouseRegion { anchors.fill: parent; onClicked: bloomEffect.running = !bloomEffect.running }
+ effect: Colorize { color: "blue" }
}
- Text { text: "Bloom"; anchors.top: bloom.bottom; anchors.horizontalCenter: bloom.horizontalCenter }
+ Text { text: "Colorize"; anchors.top: colorize.bottom; anchors.horizontalCenter: colorize.horizontalCenter }
+
+ Text { text: "Drop Shadow"; anchors.top: dropShadow.bottom; anchors.horizontalCenter: dropShadow.horizontalCenter }
Text {
- x: 100; y: 250
- text: "Clicking Blur, Pixelize, Drop Shadow or Bloom will \ntoggle animation."
+ y: 155; anchors.horizontalCenter: parent.horizontalCenter
+ text: "Clicking Blur or Drop Shadow will \ntoggle animation."
color: "black"
}