aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qmltest
diff options
context:
space:
mode:
authorMichael Brasser <mbrasser@ford.com>2017-10-26 21:52:00 -0500
committerMichael Brasser <michael.brasser@live.com>2018-05-03 14:04:58 +0000
commit9506f274faf75f48b2d6639647603feab401eb8b (patch)
treec76a7c14f9f3067b21ee3bde8e320c0d93f179fc /tests/auto/qmltest
parent96bb8ff5dd133a00bff6a7a713c59736441e1c78 (diff)
Add support for horizontal gradients in Rectangle
[ChangeLog][QtQuick] Added support for horizontal gradients in Rectangle. Change-Id: I4feee8ec93d9fe75a9f91a7afbe33c8d4756cedb Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Robin Burchell <robin.burchell@crimson.no>
Diffstat (limited to 'tests/auto/qmltest')
-rw-r--r--tests/auto/qmltest/rectangle/tst_rectangle.qml23
1 files changed, 22 insertions, 1 deletions
diff --git a/tests/auto/qmltest/rectangle/tst_rectangle.qml b/tests/auto/qmltest/rectangle/tst_rectangle.qml
index 9af55b6a79..cf57da0d73 100644
--- a/tests/auto/qmltest/rectangle/tst_rectangle.qml
+++ b/tests/auto/qmltest/rectangle/tst_rectangle.qml
@@ -48,7 +48,7 @@
**
****************************************************************************/
-import QtQuick 2.0
+import QtQuick 2.12
import QtTest 1.1
Item {
@@ -83,6 +83,17 @@ Item {
}
Rectangle {
+ id: horizontalGradient
+ width: 300
+ height: 100
+ gradient: Gradient {
+ orientation: Gradient.Horizontal
+ GradientStop { position: 0.0; color: "red" }
+ GradientStop { position: 1.0; color: "green" }
+ }
+ }
+
+ Rectangle {
id: rectangleborder
width: 300
height: 150
@@ -132,8 +143,18 @@ Item {
compare(gstops[0].color.toString(), "#ff0000")
compare(gstops[1].color.toString(), "#ffff00")
compare(gstops[2].color.toString(), "#008000")
+ compare(grad.orientation, Gradient.Vertical)
+ }
+
+ function test_horizontalGradient() {
+ var grad = horizontalGradient.gradient;
+ var gstops = grad.stops;
+ compare(gstops[0].color.toString(), "#ff0000")
+ compare(gstops[1].color.toString(), "#008000")
+ compare(grad.orientation, Gradient.Horizontal)
}
+
function test_borders() {
compare(rectangleborder.border.width, 1)
compare(rectangleborder.border.color.toString(), "#808080")