From 8c39a1ad27594e514afad12fd089ccd988bf4519 Mon Sep 17 00:00:00 2001 From: Yann Bodson Date: Mon, 2 Nov 2009 15:43:59 +1000 Subject: move smooth example in visual tests --- examples/declarative/smooth/GradientRect.qml | 25 -- examples/declarative/smooth/MyRect.qml | 21 -- examples/declarative/smooth/rect-painting.qml | 64 ---- .../auto/declarative/visual/rect/GradientRect.qml | 25 ++ tests/auto/declarative/visual/rect/MyRect.qml | 21 ++ .../visual/rect/data/rect-painting.0.png | Bin 0 -> 32225 bytes .../declarative/visual/rect/data/rect-painting.qml | 355 +++++++++++++++++++++ .../auto/declarative/visual/rect/rect-painting.qml | 64 ++++ 8 files changed, 465 insertions(+), 110 deletions(-) delete mode 100644 examples/declarative/smooth/GradientRect.qml delete mode 100644 examples/declarative/smooth/MyRect.qml delete mode 100644 examples/declarative/smooth/rect-painting.qml create mode 100644 tests/auto/declarative/visual/rect/GradientRect.qml create mode 100644 tests/auto/declarative/visual/rect/MyRect.qml create mode 100644 tests/auto/declarative/visual/rect/data/rect-painting.0.png create mode 100644 tests/auto/declarative/visual/rect/data/rect-painting.qml create mode 100644 tests/auto/declarative/visual/rect/rect-painting.qml diff --git a/examples/declarative/smooth/GradientRect.qml b/examples/declarative/smooth/GradientRect.qml deleted file mode 100644 index ed56418..0000000 --- a/examples/declarative/smooth/GradientRect.qml +++ /dev/null @@ -1,25 +0,0 @@ -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/examples/declarative/smooth/MyRect.qml b/examples/declarative/smooth/MyRect.qml deleted file mode 100644 index 9b6c3ae..0000000 --- a/examples/declarative/smooth/MyRect.qml +++ /dev/null @@ -1,21 +0,0 @@ -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/examples/declarative/smooth/rect-painting.qml b/examples/declarative/smooth/rect-painting.qml deleted file mode 100644 index 4b6e223..0000000 --- a/examples/declarative/smooth/rect-painting.qml +++ /dev/null @@ -1,64 +0,0 @@ -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 - } -} 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 Binary files /dev/null and b/tests/auto/declarative/visual/rect/data/rect-painting.0.png 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 + } +} -- cgit v0.12