summaryrefslogtreecommitdiffstats
path: root/examples/declarative/border-image/content
diff options
context:
space:
mode:
Diffstat (limited to 'examples/declarative/border-image/content')
-rw-r--r--examples/declarative/border-image/content/MyBorderImage.qml25
-rw-r--r--examples/declarative/border-image/content/ShadowRectangle.qml14
-rw-r--r--examples/declarative/border-image/content/shadow.pngbin0 -> 588 bytes
3 files changed, 33 insertions, 6 deletions
diff --git a/examples/declarative/border-image/content/MyBorderImage.qml b/examples/declarative/border-image/content/MyBorderImage.qml
index f65f093..b47df7b 100644
--- a/examples/declarative/border-image/content/MyBorderImage.qml
+++ b/examples/declarative/border-image/content/MyBorderImage.qml
@@ -1,6 +1,8 @@
import Qt 4.7
Item {
+ id: container
+
property alias horizontalMode: image.horizontalTileMode
property alias verticalMode: image.verticalTileMode
property alias source: image.source
@@ -11,22 +13,33 @@ Item {
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
+ id: image; anchors.centerIn: parent
SequentialAnimation on width {
loops: Animation.Infinite
- NumberAnimation { from: container.minWidth; to: container.maxWidth; duration: 2000; easing.type: "InOutQuad"}
- NumberAnimation { from: container.maxWidth; to: container.minWidth; duration: 2000; easing.type: "InOutQuad" }
+ NumberAnimation {
+ from: container.minWidth; to: container.maxWidth
+ duration: 2000; easing.type: Easing.InOutQuad
+ }
+ NumberAnimation {
+ from: container.maxWidth; to: container.minWidth
+ duration: 2000; easing.type: Easing.InOutQuad
+ }
}
SequentialAnimation on height {
loops: Animation.Infinite
- NumberAnimation { from: container.minHeight; to: container.maxHeight; duration: 2000; easing.type: "InOutQuad"}
- NumberAnimation { from: container.maxHeight; to: container.minHeight; duration: 2000; easing.type: "InOutQuad" }
+ NumberAnimation {
+ from: container.minHeight; to: container.maxHeight
+ duration: 2000; easing.type: Easing.InOutQuad
+ }
+ NumberAnimation {
+ from: container.maxHeight; to: container.minHeight
+ duration: 2000; easing.type: Easing.InOutQuad
+ }
}
border.top: container.margin
diff --git a/examples/declarative/border-image/content/ShadowRectangle.qml b/examples/declarative/border-image/content/ShadowRectangle.qml
new file mode 100644
index 0000000..629478b
--- /dev/null
+++ b/examples/declarative/border-image/content/ShadowRectangle.qml
@@ -0,0 +1,14 @@
+import Qt 4.7
+
+Item {
+ property alias color : rectangle.color
+
+ BorderImage {
+ anchors.fill: rectangle
+ anchors { leftMargin: -6; topMargin: -6; rightMargin: -8; bottomMargin: -8 }
+ border { left: 10; top: 10; right: 10; bottom: 10 }
+ source: "shadow.png"; smooth: true
+ }
+
+ Rectangle { id: rectangle; anchors.fill: parent }
+}
diff --git a/examples/declarative/border-image/content/shadow.png b/examples/declarative/border-image/content/shadow.png
new file mode 100644
index 0000000..431af85
--- /dev/null
+++ b/examples/declarative/border-image/content/shadow.png
Binary files differ