From 72932c6683729071c1acb3f4832c5dc53a561bdd Mon Sep 17 00:00:00 2001 From: Yann Bodson Date: Fri, 30 Oct 2009 11:50:47 +1000 Subject: cleanup --- .../declarative/border-image/MyBorderImage.qml | 37 ---------- examples/declarative/border-image/animated.qml | 17 ++--- examples/declarative/border-image/borders.qml | 4 +- examples/declarative/border-image/bw.png | Bin 1357 -> 0 bytes examples/declarative/border-image/colors-round.sci | 7 -- .../declarative/border-image/colors-stretch.sci | 5 -- examples/declarative/border-image/colors.png | Bin 1655 -> 0 bytes .../border-image/content/MyBorderImage.qml | 37 ++++++++++ examples/declarative/border-image/content/bw.png | Bin 0 -> 1357 bytes .../border-image/content/colors-round.sci | 7 ++ .../border-image/content/colors-stretch.sci | 5 ++ .../declarative/border-image/content/colors.png | Bin 0 -> 1655 bytes examples/declarative/border-image/example.qml | 31 --------- examples/declarative/clock/Clock.qml | 77 --------------------- examples/declarative/clock/background.png | Bin 46895 -> 0 bytes examples/declarative/clock/center.png | Bin 765 -> 0 bytes examples/declarative/clock/clock.png | Bin 21780 -> 0 bytes examples/declarative/clock/display.qml | 14 ---- examples/declarative/clock/hour.png | Bin 625 -> 0 bytes examples/declarative/clock/minute.png | Bin 625 -> 0 bytes examples/declarative/clock/second.png | Bin 303 -> 0 bytes examples/declarative/clocks/clocks.qml | 15 ++++ examples/declarative/clocks/content/Clock.qml | 77 +++++++++++++++++++++ examples/declarative/clocks/content/background.png | Bin 0 -> 46895 bytes examples/declarative/clocks/content/center.png | Bin 0 -> 765 bytes examples/declarative/clocks/content/clock.png | Bin 0 -> 21780 bytes examples/declarative/clocks/content/hour.png | Bin 0 -> 625 bytes examples/declarative/clocks/content/minute.png | Bin 0 -> 625 bytes examples/declarative/clocks/content/second.png | Bin 0 -> 303 bytes 29 files changed, 152 insertions(+), 181 deletions(-) delete mode 100644 examples/declarative/border-image/MyBorderImage.qml delete mode 100644 examples/declarative/border-image/bw.png delete mode 100644 examples/declarative/border-image/colors-round.sci delete mode 100644 examples/declarative/border-image/colors-stretch.sci delete mode 100644 examples/declarative/border-image/colors.png create mode 100644 examples/declarative/border-image/content/MyBorderImage.qml create mode 100644 examples/declarative/border-image/content/bw.png create mode 100644 examples/declarative/border-image/content/colors-round.sci create mode 100644 examples/declarative/border-image/content/colors-stretch.sci create mode 100644 examples/declarative/border-image/content/colors.png delete mode 100644 examples/declarative/border-image/example.qml delete mode 100644 examples/declarative/clock/Clock.qml delete mode 100644 examples/declarative/clock/background.png delete mode 100755 examples/declarative/clock/center.png delete mode 100755 examples/declarative/clock/clock.png delete mode 100644 examples/declarative/clock/display.qml delete mode 100755 examples/declarative/clock/hour.png delete mode 100755 examples/declarative/clock/minute.png delete mode 100755 examples/declarative/clock/second.png create mode 100644 examples/declarative/clocks/clocks.qml create mode 100644 examples/declarative/clocks/content/Clock.qml create mode 100644 examples/declarative/clocks/content/background.png create mode 100755 examples/declarative/clocks/content/center.png create mode 100755 examples/declarative/clocks/content/clock.png create mode 100755 examples/declarative/clocks/content/hour.png create mode 100755 examples/declarative/clocks/content/minute.png create mode 100755 examples/declarative/clocks/content/second.png diff --git a/examples/declarative/border-image/MyBorderImage.qml b/examples/declarative/border-image/MyBorderImage.qml deleted file mode 100644 index 9eb1270..0000000 --- a/examples/declarative/border-image/MyBorderImage.qml +++ /dev/null @@ -1,37 +0,0 @@ -import Qt 4.6 - -Item { - property alias horizontalMode: image.horizontalTileMode - property alias verticalMode: image.verticalTileMode - property alias source: image.source - - property int minWidth - property int minHeight - property int maxWidth - property int maxHeight - property int margin - - id: container - width: 240; height: 240 - - BorderImage { - id: image; x: container.width / 2 - width / 2; y: container.height / 2 - height / 2 - - width: SequentialAnimation { - running: true; repeat: true - NumberAnimation { from: container.minWidth; to: container.maxWidth; duration: 2000; easing: "easeInOutQuad"} - NumberAnimation { from: container.maxWidth; to: container.minWidth; duration: 2000; easing: "easeInOutQuad" } - } - - height: SequentialAnimation { - running: true; repeat: true - NumberAnimation { from: container.minHeight; to: container.maxHeight; duration: 2000; easing: "easeInOutQuad"} - NumberAnimation { from: container.maxHeight; to: container.minHeight; duration: 2000; easing: "easeInOutQuad" } - } - - border.top: container.margin - border.left: container.margin - border.bottom: container.margin - border.right: container.margin - } -} diff --git a/examples/declarative/border-image/animated.qml b/examples/declarative/border-image/animated.qml index aaaf495..29c02b3 100644 --- a/examples/declarative/border-image/animated.qml +++ b/examples/declarative/border-image/animated.qml @@ -1,4 +1,5 @@ import Qt 4.6 +import "content" Rectangle { id: page @@ -8,47 +9,47 @@ Rectangle { MyBorderImage { x: 20; y: 20; minWidth: 120; maxWidth: 240 minHeight: 120; maxHeight: 240 - source: "colors.png"; margin: 30 + source: "content/colors.png"; margin: 30 } MyBorderImage { x: 270; y: 20; minWidth: 120; maxWidth: 240 minHeight: 120; maxHeight: 240 - source: "colors.png"; margin: 30 + source: "content/colors.png"; margin: 30 horizontalMode: BorderImage.Repeat; verticalMode: BorderImage.Repeat } MyBorderImage { x: 520; y: 20; minWidth: 120; maxWidth: 240 minHeight: 120; maxHeight: 240 - source: "colors.png"; margin: 30 + source: "content/colors.png"; margin: 30 horizontalMode: BorderImage.Stretch; verticalMode: BorderImage.Repeat } MyBorderImage { x: 770; y: 20; minWidth: 120; maxWidth: 240 minHeight: 120; maxHeight: 240 - source: "colors.png"; margin: 30 + source: "content/colors.png"; margin: 30 horizontalMode: BorderImage.Round; verticalMode: BorderImage.Round } MyBorderImage { x: 20; y: 280; minWidth: 60; maxWidth: 200 minHeight: 40; maxHeight: 200 - source: "bw.png"; margin: 10 + source: "content/bw.png"; margin: 10 } MyBorderImage { x: 270; y: 280; minWidth: 60; maxWidth: 200 minHeight: 40; maxHeight: 200 - source: "bw.png"; margin: 10 + source: "content/bw.png"; margin: 10 horizontalMode: BorderImage.Repeat; verticalMode: BorderImage.Repeat } MyBorderImage { x: 520; y: 280; minWidth: 60; maxWidth: 200 minHeight: 40; maxHeight: 200 - source: "bw.png"; margin: 10 + source: "content/bw.png"; margin: 10 horizontalMode: BorderImage.Stretch; verticalMode: BorderImage.Repeat } MyBorderImage { x: 770; y: 280; minWidth: 60; maxWidth: 200 minHeight: 40; maxHeight: 200 - source: "bw.png"; margin: 10 + source: "content/bw.png"; margin: 10 horizontalMode: BorderImage.Round; verticalMode: BorderImage.Round } } diff --git a/examples/declarative/border-image/borders.qml b/examples/declarative/border-image/borders.qml index e90abe6..9879416 100644 --- a/examples/declarative/border-image/borders.qml +++ b/examples/declarative/border-image/borders.qml @@ -8,11 +8,11 @@ Rectangle { BorderImage { x: 20; y: 20; width: 230; height: 240 smooth: true - source: "colors-stretch.sci" + source: "content/colors-stretch.sci" } BorderImage { x: 270; y: 20; width: 230; height: 240 smooth: true - source: "colors-round.sci" + source: "content/colors-round.sci" } } diff --git a/examples/declarative/border-image/bw.png b/examples/declarative/border-image/bw.png deleted file mode 100644 index 486eaae..0000000 Binary files a/examples/declarative/border-image/bw.png and /dev/null differ diff --git a/examples/declarative/border-image/colors-round.sci b/examples/declarative/border-image/colors-round.sci deleted file mode 100644 index 506f6f5..0000000 --- a/examples/declarative/border-image/colors-round.sci +++ /dev/null @@ -1,7 +0,0 @@ -border.left:30 -border.top:30 -border.right:30 -border.bottom:30 -horizontalTileRule:Round -verticalTileRule:Round -source:colors.png diff --git a/examples/declarative/border-image/colors-stretch.sci b/examples/declarative/border-image/colors-stretch.sci deleted file mode 100644 index e4989a7..0000000 --- a/examples/declarative/border-image/colors-stretch.sci +++ /dev/null @@ -1,5 +0,0 @@ -border.left:30 -border.top:30 -border.right:30 -border.bottom:30 -source:colors.png diff --git a/examples/declarative/border-image/colors.png b/examples/declarative/border-image/colors.png deleted file mode 100644 index dfb62f3..0000000 Binary files a/examples/declarative/border-image/colors.png and /dev/null differ diff --git a/examples/declarative/border-image/content/MyBorderImage.qml b/examples/declarative/border-image/content/MyBorderImage.qml new file mode 100644 index 0000000..9eb1270 --- /dev/null +++ b/examples/declarative/border-image/content/MyBorderImage.qml @@ -0,0 +1,37 @@ +import Qt 4.6 + +Item { + property alias horizontalMode: image.horizontalTileMode + property alias verticalMode: image.verticalTileMode + property alias source: image.source + + property int minWidth + property int minHeight + property int maxWidth + property int maxHeight + property int margin + + id: container + width: 240; height: 240 + + BorderImage { + id: image; x: container.width / 2 - width / 2; y: container.height / 2 - height / 2 + + width: SequentialAnimation { + running: true; repeat: true + NumberAnimation { from: container.minWidth; to: container.maxWidth; duration: 2000; easing: "easeInOutQuad"} + NumberAnimation { from: container.maxWidth; to: container.minWidth; duration: 2000; easing: "easeInOutQuad" } + } + + height: SequentialAnimation { + running: true; repeat: true + NumberAnimation { from: container.minHeight; to: container.maxHeight; duration: 2000; easing: "easeInOutQuad"} + NumberAnimation { from: container.maxHeight; to: container.minHeight; duration: 2000; easing: "easeInOutQuad" } + } + + border.top: container.margin + border.left: container.margin + border.bottom: container.margin + border.right: container.margin + } +} diff --git a/examples/declarative/border-image/content/bw.png b/examples/declarative/border-image/content/bw.png new file mode 100644 index 0000000..486eaae Binary files /dev/null and b/examples/declarative/border-image/content/bw.png differ diff --git a/examples/declarative/border-image/content/colors-round.sci b/examples/declarative/border-image/content/colors-round.sci new file mode 100644 index 0000000..506f6f5 --- /dev/null +++ b/examples/declarative/border-image/content/colors-round.sci @@ -0,0 +1,7 @@ +border.left:30 +border.top:30 +border.right:30 +border.bottom:30 +horizontalTileRule:Round +verticalTileRule:Round +source:colors.png diff --git a/examples/declarative/border-image/content/colors-stretch.sci b/examples/declarative/border-image/content/colors-stretch.sci new file mode 100644 index 0000000..e4989a7 --- /dev/null +++ b/examples/declarative/border-image/content/colors-stretch.sci @@ -0,0 +1,5 @@ +border.left:30 +border.top:30 +border.right:30 +border.bottom:30 +source:colors.png diff --git a/examples/declarative/border-image/content/colors.png b/examples/declarative/border-image/content/colors.png new file mode 100644 index 0000000..dfb62f3 Binary files /dev/null and b/examples/declarative/border-image/content/colors.png differ diff --git a/examples/declarative/border-image/example.qml b/examples/declarative/border-image/example.qml deleted file mode 100644 index 25c19d9..0000000 --- a/examples/declarative/border-image/example.qml +++ /dev/null @@ -1,31 +0,0 @@ -import Qt 4.6 - -Rectangle { - id: page - color: "white" - width: 520; height: 280 - - Row { - anchors.centerIn: parent - spacing: 50 -//! [0] - BorderImage { - width: 180; height: 180 - border.left: 30; border.top: 30 - border.right: 30; border.bottom: 30 - horizontalTileMode: BorderImage.Stretch - verticalTileMode: BorderImage.Stretch - source: "colors.png" - } - - BorderImage { - width: 180; height: 180 - border.left: 30; border.top: 30 - border.right: 30; border.bottom: 30 - horizontalTileMode: BorderImage.Round - verticalTileMode: BorderImage.Round - source: "colors.png" - } -//! [0] - } -} diff --git a/examples/declarative/clock/Clock.qml b/examples/declarative/clock/Clock.qml deleted file mode 100644 index 636c99f..0000000 --- a/examples/declarative/clock/Clock.qml +++ /dev/null @@ -1,77 +0,0 @@ -import Qt 4.6 - -Item { - id: clock - width: 200; height: 230 - - property alias city: cityLabel.text - property var hours - property var minutes - property var seconds - property int shift : 0 - - function timeChanged() { - var date = new Date; - hours = date.getUTCHours() + clock.shift - minutes = date.getUTCMinutes(); - seconds = date.getUTCSeconds(); - } - - Timer { - interval: 1000; running: true; repeat: true; triggeredOnStart: true - onTriggered: clock.timeChanged() - } - - Image { id: background; source: "clock.png" } - - Image { - x: 92.5; y: 27 - source: "hour.png" - smooth: true - transform: Rotation { - id: hourRotation - origin.x: 7.5; origin.y: 73; angle: 0 - angle: SpringFollow { - spring: 2; damping: 0.2; modulus: 360 - source: (clock.hours * 30) + (clock.minutes * 0.5) - } - } - } - - Image { - x: 93.5; y: 17 - source: "minute.png" - smooth: true - transform: Rotation { - id: minuteRotation - origin.x: 6.5; origin.y: 83; angle: 0 - angle: SpringFollow { - spring: 2; damping: 0.2; modulus: 360 - source: clock.minutes * 6 - } - } - } - - Image { - x: 97.5; y: 20 - source: "second.png" - smooth: true - transform: Rotation { - id: secondRotation - origin.x: 2.5; origin.y: 80; angle: 0 - angle: SpringFollow { - spring: 5; damping: 0.25; modulus: 360 - source: clock.seconds * 6 - } - } - } - - Image { - anchors.centerIn: background; source: "center.png" - } - - Text { - id: cityLabel; font.bold: true; font.pixelSize: 14; y:200; color: "white" - anchors.horizontalCenter: parent.horizontalCenter - } -} diff --git a/examples/declarative/clock/background.png b/examples/declarative/clock/background.png deleted file mode 100644 index a885950..0000000 Binary files a/examples/declarative/clock/background.png and /dev/null differ diff --git a/examples/declarative/clock/center.png b/examples/declarative/clock/center.png deleted file mode 100755 index 7fbd802..0000000 Binary files a/examples/declarative/clock/center.png and /dev/null differ diff --git a/examples/declarative/clock/clock.png b/examples/declarative/clock/clock.png deleted file mode 100755 index 30bc577..0000000 Binary files a/examples/declarative/clock/clock.png and /dev/null differ diff --git a/examples/declarative/clock/display.qml b/examples/declarative/clock/display.qml deleted file mode 100644 index 927adfa..0000000 --- a/examples/declarative/clock/display.qml +++ /dev/null @@ -1,14 +0,0 @@ -import Qt 4.6 - -Rectangle { - width: childrenRect.width - height: childrenRect.height - color: "#646464" - - Grid { - columns: 3 - Clock { city: "New York"; shift: -4 } - Clock { city: "London" } - Clock { city: "Brisbane"; shift: 10 } - } -} diff --git a/examples/declarative/clock/hour.png b/examples/declarative/clock/hour.png deleted file mode 100755 index f8061a1..0000000 Binary files a/examples/declarative/clock/hour.png and /dev/null differ diff --git a/examples/declarative/clock/minute.png b/examples/declarative/clock/minute.png deleted file mode 100755 index 1297ec7..0000000 Binary files a/examples/declarative/clock/minute.png and /dev/null differ diff --git a/examples/declarative/clock/second.png b/examples/declarative/clock/second.png deleted file mode 100755 index 4aa9fb5..0000000 Binary files a/examples/declarative/clock/second.png and /dev/null differ diff --git a/examples/declarative/clocks/clocks.qml b/examples/declarative/clocks/clocks.qml new file mode 100644 index 0000000..3235153 --- /dev/null +++ b/examples/declarative/clocks/clocks.qml @@ -0,0 +1,15 @@ +import Qt 4.6 +import "content" + +Rectangle { + width: childrenRect.width + height: childrenRect.height + color: "#646464" + + Grid { + columns: 3 + Clock { city: "New York"; shift: -4 } + Clock { city: "London" } + Clock { city: "Brisbane"; shift: 10 } + } +} diff --git a/examples/declarative/clocks/content/Clock.qml b/examples/declarative/clocks/content/Clock.qml new file mode 100644 index 0000000..636c99f --- /dev/null +++ b/examples/declarative/clocks/content/Clock.qml @@ -0,0 +1,77 @@ +import Qt 4.6 + +Item { + id: clock + width: 200; height: 230 + + property alias city: cityLabel.text + property var hours + property var minutes + property var seconds + property int shift : 0 + + function timeChanged() { + var date = new Date; + hours = date.getUTCHours() + clock.shift + minutes = date.getUTCMinutes(); + seconds = date.getUTCSeconds(); + } + + Timer { + interval: 1000; running: true; repeat: true; triggeredOnStart: true + onTriggered: clock.timeChanged() + } + + Image { id: background; source: "clock.png" } + + Image { + x: 92.5; y: 27 + source: "hour.png" + smooth: true + transform: Rotation { + id: hourRotation + origin.x: 7.5; origin.y: 73; angle: 0 + angle: SpringFollow { + spring: 2; damping: 0.2; modulus: 360 + source: (clock.hours * 30) + (clock.minutes * 0.5) + } + } + } + + Image { + x: 93.5; y: 17 + source: "minute.png" + smooth: true + transform: Rotation { + id: minuteRotation + origin.x: 6.5; origin.y: 83; angle: 0 + angle: SpringFollow { + spring: 2; damping: 0.2; modulus: 360 + source: clock.minutes * 6 + } + } + } + + Image { + x: 97.5; y: 20 + source: "second.png" + smooth: true + transform: Rotation { + id: secondRotation + origin.x: 2.5; origin.y: 80; angle: 0 + angle: SpringFollow { + spring: 5; damping: 0.25; modulus: 360 + source: clock.seconds * 6 + } + } + } + + Image { + anchors.centerIn: background; source: "center.png" + } + + Text { + id: cityLabel; font.bold: true; font.pixelSize: 14; y:200; color: "white" + anchors.horizontalCenter: parent.horizontalCenter + } +} diff --git a/examples/declarative/clocks/content/background.png b/examples/declarative/clocks/content/background.png new file mode 100644 index 0000000..a885950 Binary files /dev/null and b/examples/declarative/clocks/content/background.png differ diff --git a/examples/declarative/clocks/content/center.png b/examples/declarative/clocks/content/center.png new file mode 100755 index 0000000..7fbd802 Binary files /dev/null and b/examples/declarative/clocks/content/center.png differ diff --git a/examples/declarative/clocks/content/clock.png b/examples/declarative/clocks/content/clock.png new file mode 100755 index 0000000..30bc577 Binary files /dev/null and b/examples/declarative/clocks/content/clock.png differ diff --git a/examples/declarative/clocks/content/hour.png b/examples/declarative/clocks/content/hour.png new file mode 100755 index 0000000..f8061a1 Binary files /dev/null and b/examples/declarative/clocks/content/hour.png differ diff --git a/examples/declarative/clocks/content/minute.png b/examples/declarative/clocks/content/minute.png new file mode 100755 index 0000000..1297ec7 Binary files /dev/null and b/examples/declarative/clocks/content/minute.png differ diff --git a/examples/declarative/clocks/content/second.png b/examples/declarative/clocks/content/second.png new file mode 100755 index 0000000..4aa9fb5 Binary files /dev/null and b/examples/declarative/clocks/content/second.png differ -- cgit v0.12