From 560b617b9a1e7a5bdc837d30886061c15c16deca Mon Sep 17 00:00:00 2001 From: Yann Bodson Date: Fri, 30 Oct 2009 16:33:42 +1000 Subject: cleanup --- examples/declarative/animation/color-animation.qml | 73 -------------- examples/declarative/animation/easing.qml | 99 ------------------- .../declarative/animation/images/face-smile.png | Bin 15408 -> 0 bytes examples/declarative/animation/images/moon.png | Bin 2433 -> 0 bytes examples/declarative/animation/images/shadow.png | Bin 425 -> 0 bytes examples/declarative/animation/images/star.png | Bin 349 -> 0 bytes examples/declarative/animation/images/sun.png | Bin 8153 -> 0 bytes .../declarative/animation/property-animation.qml | 64 ------------ .../declarative/animations/color-animation.qml | 73 ++++++++++++++ examples/declarative/animations/easing.qml | 99 +++++++++++++++++++ .../declarative/animations/images/face-smile.png | Bin 0 -> 15408 bytes examples/declarative/animations/images/moon.png | Bin 0 -> 2433 bytes examples/declarative/animations/images/shadow.png | Bin 0 -> 425 bytes examples/declarative/animations/images/star.png | Bin 0 -> 349 bytes examples/declarative/animations/images/sun.png | Bin 0 -> 8153 bytes .../declarative/animations/property-animation.qml | 64 ++++++++++++ examples/declarative/effects/effects.qml | 110 +++++++++++++++++++++ examples/declarative/effects/pic.jpg | Bin 7016 -> 0 bytes examples/declarative/effects/test.qml | 110 --------------------- 19 files changed, 346 insertions(+), 346 deletions(-) delete mode 100644 examples/declarative/animation/color-animation.qml delete mode 100644 examples/declarative/animation/easing.qml delete mode 100644 examples/declarative/animation/images/face-smile.png delete mode 100644 examples/declarative/animation/images/moon.png delete mode 100644 examples/declarative/animation/images/shadow.png delete mode 100644 examples/declarative/animation/images/star.png delete mode 100644 examples/declarative/animation/images/sun.png delete mode 100644 examples/declarative/animation/property-animation.qml create mode 100644 examples/declarative/animations/color-animation.qml create mode 100644 examples/declarative/animations/easing.qml create mode 100644 examples/declarative/animations/images/face-smile.png create mode 100644 examples/declarative/animations/images/moon.png create mode 100644 examples/declarative/animations/images/shadow.png create mode 100644 examples/declarative/animations/images/star.png create mode 100644 examples/declarative/animations/images/sun.png create mode 100644 examples/declarative/animations/property-animation.qml create mode 100644 examples/declarative/effects/effects.qml delete mode 100644 examples/declarative/effects/pic.jpg delete mode 100644 examples/declarative/effects/test.qml diff --git a/examples/declarative/animation/color-animation.qml b/examples/declarative/animation/color-animation.qml deleted file mode 100644 index edb0659..0000000 --- a/examples/declarative/animation/color-animation.qml +++ /dev/null @@ -1,73 +0,0 @@ -import Qt 4.6 - -Item { - id: window - width: 640; height: 480 - - // Let's draw the sky... - Rectangle { - anchors { left: parent.left; top: parent.top; right: parent.right; bottom: parent.verticalCenter } - gradient: Gradient { - GradientStop { - position: 0.0 - color: SequentialAnimation { - running: true; repeat: true - ColorAnimation { from: "DeepSkyBlue"; to: "#0E1533"; duration: 5000 } - ColorAnimation { from: "#0E1533"; to: "DeepSkyBlue"; duration: 5000 } - } - } - GradientStop { - position: 1.0 - color: SequentialAnimation { - running: true; repeat: true - ColorAnimation { from: "SkyBlue"; to: "#437284"; duration: 5000 } - ColorAnimation { from: "#437284"; to: "SkyBlue"; duration: 5000 } - } - } - } - } - - // the sun, moon, and stars - Item { - width: parent.width; height: 2 * parent.height - transformOrigin: Item.Center - rotation: SequentialAnimation { - running: true; repeat: true - NumberAnimation { from: 0; to: 360; duration: 10000 } - } - Image { - source: "images/sun.png"; y: 10; anchors.horizontalCenter: parent.horizontalCenter - transformOrigin: Item.Center; rotation: -3 * parent.rotation - } - Image { - source: "images/moon.png"; y: parent.height - 74; anchors.horizontalCenter: parent.horizontalCenter - transformOrigin: Item.Center; rotation: -parent.rotation - } - Particles { - x: 0; y: parent.height/2; width: parent.width; height: parent.height/2 - source: "images/star.png"; angleDeviation: 360; velocity: 0 - velocityDeviation: 0; count: parent.width / 10; fadeInDuration: 2800 - opacity: SequentialAnimation { - running: true; repeat: true - NumberAnimation { from: 0; to: 1; duration: 5000 } - NumberAnimation { from: 1; to: 0; duration: 5000 } - } - } - } - - // ...and the ground. - Rectangle { - anchors { left: parent.left; top: parent.verticalCenter; right: parent.right; bottom: parent.bottom } - gradient: Gradient { - GradientStop { - position: 0.0 - color: SequentialAnimation { - running: true; repeat: true - ColorAnimation { from: "ForestGreen"; to: "#001600"; duration: 5000 } - ColorAnimation { from: "#001600"; to: "ForestGreen"; duration: 5000 } - } - } - GradientStop { position: 1.0; color: "DarkGreen" } - } - } -} diff --git a/examples/declarative/animation/easing.qml b/examples/declarative/animation/easing.qml deleted file mode 100644 index 59e9b17..0000000 --- a/examples/declarative/animation/easing.qml +++ /dev/null @@ -1,99 +0,0 @@ -import Qt 4.6 - -Rectangle { - id: window - width: 600; height: 460; color: "#232323" - - ListModel { - id: easingTypes - ListElement { type: "easeLinear"; ballColor: "DarkRed" } - ListElement { type: "easeInQuad"; ballColor: "IndianRed" } - ListElement { type: "easeOutQuad"; ballColor: "Salmon" } - ListElement { type: "easeInOutQuad"; ballColor: "Tomato" } - ListElement { type: "easeOutInQuad"; ballColor: "DarkOrange" } - ListElement { type: "easeInCubic"; ballColor: "Gold" } - ListElement { type: "easeOutCubic"; ballColor: "Yellow" } - ListElement { type: "easeInOutCubic"; ballColor: "PeachPuff" } - ListElement { type: "easeOutInCubic"; ballColor: "Thistle" } - ListElement { type: "easeInQuart"; ballColor: "Orchid" } - ListElement { type: "easeOutQuart"; ballColor: "Purple" } - ListElement { type: "easeInOutQuart"; ballColor: "SlateBlue" } - ListElement { type: "easeOutInQuart"; ballColor: "Chartreuse" } - ListElement { type: "easeInQuint"; ballColor: "LimeGreen" } - ListElement { type: "easeOutQuint"; ballColor: "SeaGreen" } - ListElement { type: "easeInOutQuint"; ballColor: "DarkGreen" } - ListElement { type: "easeOutInQuint"; ballColor: "Olive" } - ListElement { type: "easeInSine"; ballColor: "DarkSeaGreen" } - ListElement { type: "easeOutSine"; ballColor: "Teal" } - ListElement { type: "easeInOutSine"; ballColor: "Turquoise" } - ListElement { type: "easeOutInSine"; ballColor: "SteelBlue" } - ListElement { type: "easeInExpo"; ballColor: "SkyBlue" } - ListElement { type: "easeOutExpo"; ballColor: "RoyalBlue" } - ListElement { type: "easeInOutExpo"; ballColor: "MediumBlue" } - ListElement { type: "easeOutInExpo"; ballColor: "MidnightBlue" } - ListElement { type: "easeInCirc"; ballColor: "CornSilk" } - ListElement { type: "easeOutCirc"; ballColor: "Bisque" } - ListElement { type: "easeInOutCirc"; ballColor: "RosyBrown" } - ListElement { type: "easeOutInCirc"; ballColor: "SandyBrown" } - ListElement { type: "easeInElastic"; ballColor: "DarkGoldenRod" } - ListElement { type: "easeOutElastic"; ballColor: "Chocolate" } - ListElement { type: "easeInOutElastic"; ballColor: "SaddleBrown" } - ListElement { type: "easeOutInElastic"; ballColor: "Brown" } - ListElement { type: "easeInBack"; ballColor: "Maroon" } - ListElement { type: "easeOutBack"; ballColor: "LavenderBlush" } - ListElement { type: "easeInOutBack"; ballColor: "MistyRose" } - ListElement { type: "easeOutInBack"; ballColor: "Gainsboro" } - ListElement { type: "easeOutBounce"; ballColor: "Silver" } - ListElement { type: "easeInBounce"; ballColor: "DimGray" } - ListElement { type: "easeInOutBounce"; ballColor: "SlateGray" } - ListElement { type: "easeOutInBounce"; ballColor: "DarkSlateGray" } - } - - Component { - id: delegate - - Item { - height: 42; width: window.width - Text { text: type; anchors.centerIn: parent; color: "White" } - Rectangle { - id: slot1; color: "#121212"; x: 30; height: 32; width: 32 - border.color: "#343434"; border.width: 1; radius: 8; anchors.verticalCenter: parent.verticalCenter - } - Rectangle { - id: slot2; color: "#121212"; x: window.width - 62; height: 32; width: 32 - border.color: "#343434"; border.width: 1; radius: 8; anchors.verticalCenter: parent.verticalCenter - } - Rectangle { - id: rect; x: 30; color: "#454545" - border.color: "White"; border.width: 2 - height: 32; width: 32; radius: 8; anchors.verticalCenter: parent.verticalCenter - - MouseRegion { - onClicked: if (rect.state == '') rect.state = "right"; else rect.state = '' - anchors.fill: parent - } - - states : State { - name: "right" - PropertyChanges { target: rect; x: window.width - 62; color: ballColor } - } - - transitions: Transition { - ParallelAnimation { - NumberAnimation { properties: "x"; easing: type; duration: 1000 } - ColorAnimation { properties: "color"; easing: type; duration: 1000 } - } - } - } - } - } - - Flickable { - anchors.fill: parent; viewportHeight: layout.height - Column { - id: layout - anchors.left: parent.left; anchors.right: parent.right - Repeater { model: easingTypes; delegate: delegate } - } - } -} diff --git a/examples/declarative/animation/images/face-smile.png b/examples/declarative/animation/images/face-smile.png deleted file mode 100644 index 3d66d72..0000000 Binary files a/examples/declarative/animation/images/face-smile.png and /dev/null differ diff --git a/examples/declarative/animation/images/moon.png b/examples/declarative/animation/images/moon.png deleted file mode 100644 index 9407b2b..0000000 Binary files a/examples/declarative/animation/images/moon.png and /dev/null differ diff --git a/examples/declarative/animation/images/shadow.png b/examples/declarative/animation/images/shadow.png deleted file mode 100644 index 8270565..0000000 Binary files a/examples/declarative/animation/images/shadow.png and /dev/null differ diff --git a/examples/declarative/animation/images/star.png b/examples/declarative/animation/images/star.png deleted file mode 100644 index 27ef924..0000000 Binary files a/examples/declarative/animation/images/star.png and /dev/null differ diff --git a/examples/declarative/animation/images/sun.png b/examples/declarative/animation/images/sun.png deleted file mode 100644 index 7713ca5..0000000 Binary files a/examples/declarative/animation/images/sun.png and /dev/null differ diff --git a/examples/declarative/animation/property-animation.qml b/examples/declarative/animation/property-animation.qml deleted file mode 100644 index 0256137..0000000 --- a/examples/declarative/animation/property-animation.qml +++ /dev/null @@ -1,64 +0,0 @@ -import Qt 4.6 - -Item { - id: window - width: 320; height: 480 - - // Let's draw the sky... - Rectangle { - anchors { left: parent.left; top: parent.top; right: parent.right; bottom: parent.verticalCenter } - gradient: Gradient { - GradientStop { position: 0.0; color: "DeepSkyBlue" } - GradientStop { position: 1.0; color: "LightSkyBlue" } - } - } - - // ...and the ground. - Rectangle { - anchors { left: parent.left; top: parent.verticalCenter; right: parent.right; bottom: parent.bottom } - gradient: Gradient { - GradientStop { position: 0.0; color: "ForestGreen" } - GradientStop { position: 1.0; color: "DarkGreen" } - } - } - - // The shadow for the smiley face - Image { - anchors.horizontalCenter: parent.horizontalCenter - source: "images/shadow.png"; y: smiley.minHeight + 58 - transformOrigin: Item.Center - - // The scale property depends on the y position of the smiley face. - scale: smiley.y * 0.5 / (smiley.minHeight - smiley.maxHeight) - } - - Image { - id: smiley - property int maxHeight: window.height / 3 - property int minHeight: 2 * window.height / 3 - - anchors.horizontalCenter: parent.horizontalCenter - source: "images/face-smile.png"; y: minHeight - - // Animate the y property. Setting repeat to true makes the - // animation repeat indefinitely, otherwise it would only run once. - y: SequentialAnimation { - running: true; repeat: true - - // Move from minHeight to maxHeight in 300ms, using the easeOutExpo easing function - NumberAnimation { - from: smiley.minHeight; to: smiley.maxHeight - easing: "easeOutExpo"; duration: 300 - } - - // Then move back to minHeight in 1 second, using the easeOutBounce easing function - NumberAnimation { - from: smiley.maxHeight; to: smiley.minHeight - easing: "easeOutBounce"; duration: 1000 - } - - // Then pause for 500ms - PauseAnimation { duration: 500 } - } - } -} diff --git a/examples/declarative/animations/color-animation.qml b/examples/declarative/animations/color-animation.qml new file mode 100644 index 0000000..edb0659 --- /dev/null +++ b/examples/declarative/animations/color-animation.qml @@ -0,0 +1,73 @@ +import Qt 4.6 + +Item { + id: window + width: 640; height: 480 + + // Let's draw the sky... + Rectangle { + anchors { left: parent.left; top: parent.top; right: parent.right; bottom: parent.verticalCenter } + gradient: Gradient { + GradientStop { + position: 0.0 + color: SequentialAnimation { + running: true; repeat: true + ColorAnimation { from: "DeepSkyBlue"; to: "#0E1533"; duration: 5000 } + ColorAnimation { from: "#0E1533"; to: "DeepSkyBlue"; duration: 5000 } + } + } + GradientStop { + position: 1.0 + color: SequentialAnimation { + running: true; repeat: true + ColorAnimation { from: "SkyBlue"; to: "#437284"; duration: 5000 } + ColorAnimation { from: "#437284"; to: "SkyBlue"; duration: 5000 } + } + } + } + } + + // the sun, moon, and stars + Item { + width: parent.width; height: 2 * parent.height + transformOrigin: Item.Center + rotation: SequentialAnimation { + running: true; repeat: true + NumberAnimation { from: 0; to: 360; duration: 10000 } + } + Image { + source: "images/sun.png"; y: 10; anchors.horizontalCenter: parent.horizontalCenter + transformOrigin: Item.Center; rotation: -3 * parent.rotation + } + Image { + source: "images/moon.png"; y: parent.height - 74; anchors.horizontalCenter: parent.horizontalCenter + transformOrigin: Item.Center; rotation: -parent.rotation + } + Particles { + x: 0; y: parent.height/2; width: parent.width; height: parent.height/2 + source: "images/star.png"; angleDeviation: 360; velocity: 0 + velocityDeviation: 0; count: parent.width / 10; fadeInDuration: 2800 + opacity: SequentialAnimation { + running: true; repeat: true + NumberAnimation { from: 0; to: 1; duration: 5000 } + NumberAnimation { from: 1; to: 0; duration: 5000 } + } + } + } + + // ...and the ground. + Rectangle { + anchors { left: parent.left; top: parent.verticalCenter; right: parent.right; bottom: parent.bottom } + gradient: Gradient { + GradientStop { + position: 0.0 + color: SequentialAnimation { + running: true; repeat: true + ColorAnimation { from: "ForestGreen"; to: "#001600"; duration: 5000 } + ColorAnimation { from: "#001600"; to: "ForestGreen"; duration: 5000 } + } + } + GradientStop { position: 1.0; color: "DarkGreen" } + } + } +} diff --git a/examples/declarative/animations/easing.qml b/examples/declarative/animations/easing.qml new file mode 100644 index 0000000..59e9b17 --- /dev/null +++ b/examples/declarative/animations/easing.qml @@ -0,0 +1,99 @@ +import Qt 4.6 + +Rectangle { + id: window + width: 600; height: 460; color: "#232323" + + ListModel { + id: easingTypes + ListElement { type: "easeLinear"; ballColor: "DarkRed" } + ListElement { type: "easeInQuad"; ballColor: "IndianRed" } + ListElement { type: "easeOutQuad"; ballColor: "Salmon" } + ListElement { type: "easeInOutQuad"; ballColor: "Tomato" } + ListElement { type: "easeOutInQuad"; ballColor: "DarkOrange" } + ListElement { type: "easeInCubic"; ballColor: "Gold" } + ListElement { type: "easeOutCubic"; ballColor: "Yellow" } + ListElement { type: "easeInOutCubic"; ballColor: "PeachPuff" } + ListElement { type: "easeOutInCubic"; ballColor: "Thistle" } + ListElement { type: "easeInQuart"; ballColor: "Orchid" } + ListElement { type: "easeOutQuart"; ballColor: "Purple" } + ListElement { type: "easeInOutQuart"; ballColor: "SlateBlue" } + ListElement { type: "easeOutInQuart"; ballColor: "Chartreuse" } + ListElement { type: "easeInQuint"; ballColor: "LimeGreen" } + ListElement { type: "easeOutQuint"; ballColor: "SeaGreen" } + ListElement { type: "easeInOutQuint"; ballColor: "DarkGreen" } + ListElement { type: "easeOutInQuint"; ballColor: "Olive" } + ListElement { type: "easeInSine"; ballColor: "DarkSeaGreen" } + ListElement { type: "easeOutSine"; ballColor: "Teal" } + ListElement { type: "easeInOutSine"; ballColor: "Turquoise" } + ListElement { type: "easeOutInSine"; ballColor: "SteelBlue" } + ListElement { type: "easeInExpo"; ballColor: "SkyBlue" } + ListElement { type: "easeOutExpo"; ballColor: "RoyalBlue" } + ListElement { type: "easeInOutExpo"; ballColor: "MediumBlue" } + ListElement { type: "easeOutInExpo"; ballColor: "MidnightBlue" } + ListElement { type: "easeInCirc"; ballColor: "CornSilk" } + ListElement { type: "easeOutCirc"; ballColor: "Bisque" } + ListElement { type: "easeInOutCirc"; ballColor: "RosyBrown" } + ListElement { type: "easeOutInCirc"; ballColor: "SandyBrown" } + ListElement { type: "easeInElastic"; ballColor: "DarkGoldenRod" } + ListElement { type: "easeOutElastic"; ballColor: "Chocolate" } + ListElement { type: "easeInOutElastic"; ballColor: "SaddleBrown" } + ListElement { type: "easeOutInElastic"; ballColor: "Brown" } + ListElement { type: "easeInBack"; ballColor: "Maroon" } + ListElement { type: "easeOutBack"; ballColor: "LavenderBlush" } + ListElement { type: "easeInOutBack"; ballColor: "MistyRose" } + ListElement { type: "easeOutInBack"; ballColor: "Gainsboro" } + ListElement { type: "easeOutBounce"; ballColor: "Silver" } + ListElement { type: "easeInBounce"; ballColor: "DimGray" } + ListElement { type: "easeInOutBounce"; ballColor: "SlateGray" } + ListElement { type: "easeOutInBounce"; ballColor: "DarkSlateGray" } + } + + Component { + id: delegate + + Item { + height: 42; width: window.width + Text { text: type; anchors.centerIn: parent; color: "White" } + Rectangle { + id: slot1; color: "#121212"; x: 30; height: 32; width: 32 + border.color: "#343434"; border.width: 1; radius: 8; anchors.verticalCenter: parent.verticalCenter + } + Rectangle { + id: slot2; color: "#121212"; x: window.width - 62; height: 32; width: 32 + border.color: "#343434"; border.width: 1; radius: 8; anchors.verticalCenter: parent.verticalCenter + } + Rectangle { + id: rect; x: 30; color: "#454545" + border.color: "White"; border.width: 2 + height: 32; width: 32; radius: 8; anchors.verticalCenter: parent.verticalCenter + + MouseRegion { + onClicked: if (rect.state == '') rect.state = "right"; else rect.state = '' + anchors.fill: parent + } + + states : State { + name: "right" + PropertyChanges { target: rect; x: window.width - 62; color: ballColor } + } + + transitions: Transition { + ParallelAnimation { + NumberAnimation { properties: "x"; easing: type; duration: 1000 } + ColorAnimation { properties: "color"; easing: type; duration: 1000 } + } + } + } + } + } + + Flickable { + anchors.fill: parent; viewportHeight: layout.height + Column { + id: layout + anchors.left: parent.left; anchors.right: parent.right + Repeater { model: easingTypes; delegate: delegate } + } + } +} diff --git a/examples/declarative/animations/images/face-smile.png b/examples/declarative/animations/images/face-smile.png new file mode 100644 index 0000000..3d66d72 Binary files /dev/null and b/examples/declarative/animations/images/face-smile.png differ diff --git a/examples/declarative/animations/images/moon.png b/examples/declarative/animations/images/moon.png new file mode 100644 index 0000000..9407b2b Binary files /dev/null and b/examples/declarative/animations/images/moon.png differ diff --git a/examples/declarative/animations/images/shadow.png b/examples/declarative/animations/images/shadow.png new file mode 100644 index 0000000..8270565 Binary files /dev/null and b/examples/declarative/animations/images/shadow.png differ diff --git a/examples/declarative/animations/images/star.png b/examples/declarative/animations/images/star.png new file mode 100644 index 0000000..27ef924 Binary files /dev/null and b/examples/declarative/animations/images/star.png differ diff --git a/examples/declarative/animations/images/sun.png b/examples/declarative/animations/images/sun.png new file mode 100644 index 0000000..7713ca5 Binary files /dev/null and b/examples/declarative/animations/images/sun.png differ diff --git a/examples/declarative/animations/property-animation.qml b/examples/declarative/animations/property-animation.qml new file mode 100644 index 0000000..0256137 --- /dev/null +++ b/examples/declarative/animations/property-animation.qml @@ -0,0 +1,64 @@ +import Qt 4.6 + +Item { + id: window + width: 320; height: 480 + + // Let's draw the sky... + Rectangle { + anchors { left: parent.left; top: parent.top; right: parent.right; bottom: parent.verticalCenter } + gradient: Gradient { + GradientStop { position: 0.0; color: "DeepSkyBlue" } + GradientStop { position: 1.0; color: "LightSkyBlue" } + } + } + + // ...and the ground. + Rectangle { + anchors { left: parent.left; top: parent.verticalCenter; right: parent.right; bottom: parent.bottom } + gradient: Gradient { + GradientStop { position: 0.0; color: "ForestGreen" } + GradientStop { position: 1.0; color: "DarkGreen" } + } + } + + // The shadow for the smiley face + Image { + anchors.horizontalCenter: parent.horizontalCenter + source: "images/shadow.png"; y: smiley.minHeight + 58 + transformOrigin: Item.Center + + // The scale property depends on the y position of the smiley face. + scale: smiley.y * 0.5 / (smiley.minHeight - smiley.maxHeight) + } + + Image { + id: smiley + property int maxHeight: window.height / 3 + property int minHeight: 2 * window.height / 3 + + anchors.horizontalCenter: parent.horizontalCenter + source: "images/face-smile.png"; y: minHeight + + // Animate the y property. Setting repeat to true makes the + // animation repeat indefinitely, otherwise it would only run once. + y: SequentialAnimation { + running: true; repeat: true + + // Move from minHeight to maxHeight in 300ms, using the easeOutExpo easing function + NumberAnimation { + from: smiley.minHeight; to: smiley.maxHeight + easing: "easeOutExpo"; duration: 300 + } + + // Then move back to minHeight in 1 second, using the easeOutBounce easing function + NumberAnimation { + from: smiley.maxHeight; to: smiley.minHeight + easing: "easeOutBounce"; duration: 1000 + } + + // Then pause for 500ms + PauseAnimation { duration: 500 } + } + } +} diff --git a/examples/declarative/effects/effects.qml b/examples/declarative/effects/effects.qml new file mode 100644 index 0000000..851b2fe --- /dev/null +++ b/examples/declarative/effects/effects.qml @@ -0,0 +1,110 @@ +import Qt 4.6 + +Rectangle { + color: "white" + width: 600 + height: 600 + + Image { + id: blur + source: "pic.png" + + effect: Blur { + blurRadius: NumberAnimation { + id: blurEffect + from: 0; to: 10 + duration: 1000 + repeat: true + } + } + + MouseRegion { anchors.fill: parent; onClicked: blurEffect.running = !blurEffect.running } + } + + 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 + + effect: DropShadow { + blurRadius: 3 + offset.x: 3 + offset.y: NumberAnimation { id: dropShadowEffect; from: 0; to: 10; duration: 1000; repeat: true; } + } + + MouseRegion { anchors.fill: parent; onClicked: dropShadowEffect.running = !dropShadowEffect.running } + } + + Text { text: "Drop Shadow"; anchors.top: dropShadow.bottom; anchors.horizontalCenter: dropShadow.horizontalCenter } + + Image { + id: bloom + source: "pic.png" + x: 400 + y: 300 + + 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 } + } + + Text { text: "Bloom"; anchors.top: bloom.bottom; anchors.horizontalCenter: bloom.horizontalCenter } + + Text { + x: 100; y: 250 + text: "Clicking Blur, Pixelize, Drop Shadow or Bloom will \ntoggle animation." + color: "black" + } + +} diff --git a/examples/declarative/effects/pic.jpg b/examples/declarative/effects/pic.jpg deleted file mode 100644 index 5775518..0000000 Binary files a/examples/declarative/effects/pic.jpg and /dev/null differ diff --git a/examples/declarative/effects/test.qml b/examples/declarative/effects/test.qml deleted file mode 100644 index 73c6839..0000000 --- a/examples/declarative/effects/test.qml +++ /dev/null @@ -1,110 +0,0 @@ -import Qt 4.6 - -Rectangle { - color: "white" - width: 600 - height: 600 - - Image { - id: blur - source: "pic.jpg" - - effect: Blur { - blurRadius: NumberAnimation { - id: blurEffect - from: 0; to: 10 - duration: 200 - repeat: true - } - } - - MouseRegion { anchors.fill: parent; onClicked: blurEffect.running = !blurEffect.running } - } - - Text { text: "Blur"; anchors.top: blur.bottom; anchors.horizontalCenter: blur.horizontalCenter } - - Image { - id: grayscale - source: "pic.jpg" - x: 200 - - effect: Grayscale {} - } - - Text { text: "Grayscale"; anchors.top: grayscale.bottom; anchors.horizontalCenter: grayscale.horizontalCenter } - - Image { - id: colorize - source: "pic.jpg" - x: 400 - - effect: Colorize { color: "blue" } - } - - Text { text: "Colorize"; anchors.top: colorize.bottom; anchors.horizontalCenter: colorize.horizontalCenter } - - Image { - id: pixelize - source: "pic.jpg" - y: 300 - - effect: Pixelize { - pixelSize: NumberAnimation { - id: pixelizeEffect - from: 0; to: 10 - duration: 200 - 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.jpg" - x: 200 - y: 300 - - effect: DropShadow { - blurRadius: 3 - offset.x: 3 - offset.y: NumberAnimation { id: dropShadowEffect; from: 0; to: 10; duration: 200; repeat: true; } - } - - MouseRegion { anchors.fill: parent; onClicked: dropShadowEffect.running = !dropShadowEffect.running } - } - - Text { text: "Drop Shadow"; anchors.top: dropShadow.bottom; anchors.horizontalCenter: dropShadow.horizontalCenter } - - Image { - id: bloom - source: "pic.jpg" - x: 400 - y: 300 - - effect: Bloom { - blurRadius: 3 - brightness: 128 - strength: NumberAnimation { - id: bloomEffect - from: 0; to: 1 - duration: 200 - repeat: true - } - } - - MouseRegion { anchors.fill: parent; onClicked: bloomEffect.running = !bloomEffect.running } - } - - Text { text: "Bloom"; anchors.top: bloom.bottom; anchors.horizontalCenter: bloom.horizontalCenter } - - Text { - x: 100; y: 250 - text: "Clicking Blur, Pixelize, Drop Shadow or Bloom will \ntoggle animation." - color: "black" - } - -} -- cgit v0.12