summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/declarative/visual/rect/GradientRect.qml25
-rw-r--r--tests/auto/declarative/visual/rect/MyRect.qml21
-rw-r--r--tests/auto/declarative/visual/rect/data/rect-painting.0.pngbin0 -> 32225 bytes
-rw-r--r--tests/auto/declarative/visual/rect/data/rect-painting.qml355
-rw-r--r--tests/auto/declarative/visual/rect/rect-painting.qml64
5 files changed, 465 insertions, 0 deletions
diff --git a/tests/auto/declarative/visual/rect/GradientRect.qml b/tests/auto/declarative/visual/rect/GradientRect.qml
new file mode 100644
index 0000000..ed56418
--- /dev/null
+++ b/tests/auto/declarative/visual/rect/GradientRect.qml
@@ -0,0 +1,25 @@
+import Qt 4.6
+
+Item {
+ id: rect
+ property string color
+ property string border : ""
+ property int rotation
+ property int radius
+ property int borderWidth
+ property bool smooth: false
+
+ width: 80; height: 80
+ Item {
+ anchors.centerIn: parent; rotation: rect.rotation;
+ Rectangle {
+ anchors.centerIn: parent; width: 80; height: 80
+ border.color: rect.border; border.width: rect.border != "" ? 2 : 0
+ radius: rect.radius; smooth: rect.smooth
+ gradient: Gradient {
+ GradientStop { position: 0.0; color: rect.color }
+ GradientStop { position: 1.0; color: "white" }
+ }
+ }
+ }
+}
diff --git a/tests/auto/declarative/visual/rect/MyRect.qml b/tests/auto/declarative/visual/rect/MyRect.qml
new file mode 100644
index 0000000..9b6c3ae
--- /dev/null
+++ b/tests/auto/declarative/visual/rect/MyRect.qml
@@ -0,0 +1,21 @@
+import Qt 4.6
+
+Item {
+ id: rect
+ property string color
+ property string border : ""
+ property int rotation
+ property int radius
+ property int borderWidth
+ property bool smooth: false
+
+ width: 80; height: 80
+ Item {
+ anchors.centerIn: parent; rotation: rect.rotation;
+ Rectangle {
+ anchors.centerIn: parent; width: 80; height: 80
+ color: rect.color; border.color: rect.border; border.width: rect.border != "" ? 2 : 0
+ radius: rect.radius; smooth: rect.smooth
+ }
+ }
+}
diff --git a/tests/auto/declarative/visual/rect/data/rect-painting.0.png b/tests/auto/declarative/visual/rect/data/rect-painting.0.png
new file mode 100644
index 0000000..0b45874
--- /dev/null
+++ b/tests/auto/declarative/visual/rect/data/rect-painting.0.png
Binary files differ
diff --git a/tests/auto/declarative/visual/rect/data/rect-painting.qml b/tests/auto/declarative/visual/rect/data/rect-painting.qml
new file mode 100644
index 0000000..2c3267e
--- /dev/null
+++ b/tests/auto/declarative/visual/rect/data/rect-painting.qml
@@ -0,0 +1,355 @@
+import Qt.VisualTest 4.6
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ hash: "f38360b51d832ed7f70614dfe1964ec8"
+ }
+ Frame {
+ msec: 32
+ hash: "f38360b51d832ed7f70614dfe1964ec8"
+ }
+ Frame {
+ msec: 48
+ hash: "f38360b51d832ed7f70614dfe1964ec8"
+ }
+ Frame {
+ msec: 64
+ hash: "f38360b51d832ed7f70614dfe1964ec8"
+ }
+ Frame {
+ msec: 80
+ hash: "f38360b51d832ed7f70614dfe1964ec8"
+ }
+ Frame {
+ msec: 96
+ hash: "f38360b51d832ed7f70614dfe1964ec8"
+ }
+ Frame {
+ msec: 112
+ hash: "f38360b51d832ed7f70614dfe1964ec8"
+ }
+ Frame {
+ msec: 128
+ hash: "f38360b51d832ed7f70614dfe1964ec8"
+ }
+ Frame {
+ msec: 144
+ hash: "f38360b51d832ed7f70614dfe1964ec8"
+ }
+ Frame {
+ msec: 160
+ hash: "f38360b51d832ed7f70614dfe1964ec8"
+ }
+ Frame {
+ msec: 176
+ hash: "f38360b51d832ed7f70614dfe1964ec8"
+ }
+ Frame {
+ msec: 192
+ hash: "f38360b51d832ed7f70614dfe1964ec8"
+ }
+ Frame {
+ msec: 208
+ hash: "f38360b51d832ed7f70614dfe1964ec8"
+ }
+ Frame {
+ msec: 224
+ hash: "f38360b51d832ed7f70614dfe1964ec8"
+ }
+ Frame {
+ msec: 240
+ hash: "f38360b51d832ed7f70614dfe1964ec8"
+ }
+ Frame {
+ msec: 256
+ hash: "f38360b51d832ed7f70614dfe1964ec8"
+ }
+ Frame {
+ msec: 272
+ hash: "f38360b51d832ed7f70614dfe1964ec8"
+ }
+ Frame {
+ msec: 288
+ hash: "f38360b51d832ed7f70614dfe1964ec8"
+ }
+ Frame {
+ msec: 304
+ hash: "f38360b51d832ed7f70614dfe1964ec8"
+ }
+ Frame {
+ msec: 320
+ hash: "f38360b51d832ed7f70614dfe1964ec8"
+ }
+ Frame {
+ msec: 336
+ hash: "f38360b51d832ed7f70614dfe1964ec8"
+ }
+ Frame {
+ msec: 352
+ hash: "f38360b51d832ed7f70614dfe1964ec8"
+ }
+ Frame {
+ msec: 368
+ hash: "f38360b51d832ed7f70614dfe1964ec8"
+ }
+ Frame {
+ msec: 384
+ hash: "f38360b51d832ed7f70614dfe1964ec8"
+ }
+ Frame {
+ msec: 400
+ hash: "f38360b51d832ed7f70614dfe1964ec8"
+ }
+ Frame {
+ msec: 416
+ hash: "f38360b51d832ed7f70614dfe1964ec8"
+ }
+ Frame {
+ msec: 432
+ hash: "f38360b51d832ed7f70614dfe1964ec8"
+ }
+ Frame {
+ msec: 448
+ hash: "f38360b51d832ed7f70614dfe1964ec8"
+ }
+ Frame {
+ msec: 464
+ hash: "f38360b51d832ed7f70614dfe1964ec8"
+ }
+ Frame {
+ msec: 480
+ hash: "f38360b51d832ed7f70614dfe1964ec8"
+ }
+ Frame {
+ msec: 496
+ hash: "f38360b51d832ed7f70614dfe1964ec8"
+ }
+ Frame {
+ msec: 512
+ hash: "f38360b51d832ed7f70614dfe1964ec8"
+ }
+ Frame {
+ msec: 528
+ hash: "f38360b51d832ed7f70614dfe1964ec8"
+ }
+ Frame {
+ msec: 544
+ hash: "f38360b51d832ed7f70614dfe1964ec8"
+ }
+ Frame {
+ msec: 560
+ hash: "f38360b51d832ed7f70614dfe1964ec8"
+ }
+ Frame {
+ msec: 576
+ hash: "f38360b51d832ed7f70614dfe1964ec8"
+ }
+ Frame {
+ msec: 592
+ hash: "f38360b51d832ed7f70614dfe1964ec8"
+ }
+ Frame {
+ msec: 608
+ hash: "f38360b51d832ed7f70614dfe1964ec8"
+ }
+ Frame {
+ msec: 624
+ hash: "f38360b51d832ed7f70614dfe1964ec8"
+ }
+ Frame {
+ msec: 640
+ hash: "f38360b51d832ed7f70614dfe1964ec8"
+ }
+ Frame {
+ msec: 656
+ hash: "f38360b51d832ed7f70614dfe1964ec8"
+ }
+ Frame {
+ msec: 672
+ hash: "f38360b51d832ed7f70614dfe1964ec8"
+ }
+ Frame {
+ msec: 688
+ hash: "f38360b51d832ed7f70614dfe1964ec8"
+ }
+ Frame {
+ msec: 704
+ hash: "f38360b51d832ed7f70614dfe1964ec8"
+ }
+ Frame {
+ msec: 720
+ hash: "f38360b51d832ed7f70614dfe1964ec8"
+ }
+ Frame {
+ msec: 736
+ hash: "f38360b51d832ed7f70614dfe1964ec8"
+ }
+ Frame {
+ msec: 752
+ hash: "f38360b51d832ed7f70614dfe1964ec8"
+ }
+ Frame {
+ msec: 768
+ hash: "f38360b51d832ed7f70614dfe1964ec8"
+ }
+ Frame {
+ msec: 784
+ hash: "f38360b51d832ed7f70614dfe1964ec8"
+ }
+ Frame {
+ msec: 800
+ hash: "f38360b51d832ed7f70614dfe1964ec8"
+ }
+ Frame {
+ msec: 816
+ hash: "f38360b51d832ed7f70614dfe1964ec8"
+ }
+ Frame {
+ msec: 832
+ hash: "f38360b51d832ed7f70614dfe1964ec8"
+ }
+ Frame {
+ msec: 848
+ hash: "f38360b51d832ed7f70614dfe1964ec8"
+ }
+ Frame {
+ msec: 864
+ hash: "f38360b51d832ed7f70614dfe1964ec8"
+ }
+ Frame {
+ msec: 880
+ hash: "f38360b51d832ed7f70614dfe1964ec8"
+ }
+ Frame {
+ msec: 896
+ hash: "f38360b51d832ed7f70614dfe1964ec8"
+ }
+ Frame {
+ msec: 912
+ hash: "f38360b51d832ed7f70614dfe1964ec8"
+ }
+ Frame {
+ msec: 928
+ hash: "f38360b51d832ed7f70614dfe1964ec8"
+ }
+ Frame {
+ msec: 944
+ hash: "f38360b51d832ed7f70614dfe1964ec8"
+ }
+ Frame {
+ msec: 960
+ image: "rect-painting.0.png"
+ }
+ Frame {
+ msec: 976
+ hash: "f38360b51d832ed7f70614dfe1964ec8"
+ }
+ Frame {
+ msec: 992
+ hash: "f38360b51d832ed7f70614dfe1964ec8"
+ }
+ Frame {
+ msec: 1008
+ hash: "f38360b51d832ed7f70614dfe1964ec8"
+ }
+ Frame {
+ msec: 1024
+ hash: "f38360b51d832ed7f70614dfe1964ec8"
+ }
+ Frame {
+ msec: 1040
+ hash: "f38360b51d832ed7f70614dfe1964ec8"
+ }
+ Frame {
+ msec: 1056
+ hash: "f38360b51d832ed7f70614dfe1964ec8"
+ }
+ Frame {
+ msec: 1072
+ hash: "f38360b51d832ed7f70614dfe1964ec8"
+ }
+ Frame {
+ msec: 1088
+ hash: "f38360b51d832ed7f70614dfe1964ec8"
+ }
+ Frame {
+ msec: 1104
+ hash: "f38360b51d832ed7f70614dfe1964ec8"
+ }
+ Frame {
+ msec: 1120
+ hash: "f38360b51d832ed7f70614dfe1964ec8"
+ }
+ Frame {
+ msec: 1136
+ hash: "f38360b51d832ed7f70614dfe1964ec8"
+ }
+ Frame {
+ msec: 1152
+ hash: "f38360b51d832ed7f70614dfe1964ec8"
+ }
+ Frame {
+ msec: 1168
+ hash: "f38360b51d832ed7f70614dfe1964ec8"
+ }
+ Frame {
+ msec: 1184
+ hash: "f38360b51d832ed7f70614dfe1964ec8"
+ }
+ Frame {
+ msec: 1200
+ hash: "f38360b51d832ed7f70614dfe1964ec8"
+ }
+ Frame {
+ msec: 1216
+ hash: "f38360b51d832ed7f70614dfe1964ec8"
+ }
+ Frame {
+ msec: 1232
+ hash: "f38360b51d832ed7f70614dfe1964ec8"
+ }
+ Frame {
+ msec: 1248
+ hash: "f38360b51d832ed7f70614dfe1964ec8"
+ }
+ Frame {
+ msec: 1264
+ hash: "f38360b51d832ed7f70614dfe1964ec8"
+ }
+ Frame {
+ msec: 1280
+ hash: "f38360b51d832ed7f70614dfe1964ec8"
+ }
+ Frame {
+ msec: 1296
+ hash: "f38360b51d832ed7f70614dfe1964ec8"
+ }
+ Frame {
+ msec: 1312
+ hash: "f38360b51d832ed7f70614dfe1964ec8"
+ }
+ Key {
+ type: 6
+ key: 16777249
+ modifiers: 67108864
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1328
+ hash: "f38360b51d832ed7f70614dfe1964ec8"
+ }
+ Frame {
+ msec: 1344
+ hash: "f38360b51d832ed7f70614dfe1964ec8"
+ }
+ Frame {
+ msec: 1360
+ hash: "f38360b51d832ed7f70614dfe1964ec8"
+ }
+}
diff --git a/tests/auto/declarative/visual/rect/rect-painting.qml b/tests/auto/declarative/visual/rect/rect-painting.qml
new file mode 100644
index 0000000..4b6e223
--- /dev/null
+++ b/tests/auto/declarative/visual/rect/rect-painting.qml
@@ -0,0 +1,64 @@
+import Qt 4.6
+
+Rectangle {
+ width: 900; height: 500
+ color: "white"
+
+ Rectangle {
+ anchors.top: parent.verticalCenter
+ anchors.left: parent.left
+ anchors.right: parent.right
+ anchors.bottom: parent.bottom
+ color: "#eeeeee"
+ }
+
+ Grid {
+ anchors.centerIn: parent
+ columns: 8; rows:4; spacing: 30
+
+ MyRect { color: "lightsteelblue" }
+ MyRect { color: "lightsteelblue"; border: "gray" }
+ MyRect { color: "lightsteelblue"; radius: 10 }
+ MyRect { color: "lightsteelblue"; radius: 10; border: "gray" }
+ GradientRect { color: "lightsteelblue" }
+ GradientRect { color: "lightsteelblue"; border: "gray" }
+ GradientRect { color: "lightsteelblue"; radius: 10 }
+ GradientRect { color: "lightsteelblue"; radius: 10; border: "gray" }
+
+ MyRect { color: "thistle"; rotation: 10 }
+ MyRect { color: "thistle"; border: "gray"; rotation: 10 }
+ MyRect { color: "thistle"; radius: 10; rotation: 10 }
+ MyRect { color: "thistle"; radius: 10; border: "gray"; rotation: 10 }
+ GradientRect { color: "thistle"; rotation: 10 }
+ GradientRect { color: "thistle"; border: "gray"; rotation: 10 }
+ GradientRect { color: "thistle"; radius: 10; rotation: 10 }
+ GradientRect { color: "thistle"; radius: 10; border: "gray"; rotation: 10 }
+
+ MyRect { color: "lightsteelblue"; smooth: true }
+ MyRect { color: "lightsteelblue"; border: "gray"; smooth: true }
+ MyRect { color: "lightsteelblue"; radius: 10; smooth: true }
+ MyRect { color: "lightsteelblue"; radius: 10; border: "gray"; smooth: true }
+ GradientRect { color: "lightsteelblue"; smooth: true }
+ GradientRect { color: "lightsteelblue"; border: "gray"; smooth: true }
+ GradientRect { color: "lightsteelblue"; radius: 10; smooth: true }
+ GradientRect { color: "lightsteelblue"; radius: 10; border: "gray"; smooth: true }
+
+ MyRect { color: "thistle"; rotation: 10; smooth: true }
+ MyRect { color: "thistle"; border: "gray"; rotation: 10; smooth: true }
+ MyRect { color: "thistle"; radius: 10; rotation: 10; smooth: true }
+ MyRect { color: "thistle"; radius: 10; border: "gray"; rotation: 10; smooth: true }
+ GradientRect { color: "thistle"; rotation: 10; smooth: true }
+ GradientRect { color: "thistle"; border: "gray"; rotation: 10; smooth: true }
+ GradientRect { color: "thistle"; radius: 10; rotation: 10; smooth: true }
+ GradientRect { color: "thistle"; radius: 10; border: "gray"; rotation: 10; smooth: true }
+ }
+
+ Text {
+ text: "smooth: false"; font.bold: true
+ anchors.horizontalCenter: parent.horizontalCenter; anchors.top: parent.top
+ }
+ Text {
+ text: "smooth: true"; font.bold: true
+ anchors.horizontalCenter: parent.horizontalCenter; anchors.bottom: parent.bottom
+ }
+}