diff options
author | Laszlo Agocs <laszlo.agocs@qt.io> | 2017-06-06 14:54:37 +0200 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@qt.io> | 2017-06-08 10:32:18 +0000 |
commit | f4f89858cffa1107af5139dfb1e1d7b16ca3a1a0 (patch) | |
tree | 848471b6d85eebfea8915f1da89b26286f0dbbc7 /examples/quick/shapes | |
parent | 8a5837467d153c50c869625390a584b0335b77b7 (diff) |
Use GradientStop and rename ShapeLinearGradient to LinearGradient
Thus application code becomes:
ShapePath {
...
fillGradient: LinearGradient {
...
GradientStop { ... }
}
}
which is even more clean and readable. The duplication for stops is
now avoided.
Change-Id: I50ae2f388e21683a37dc4787763dc71e16eef4f5
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
Diffstat (limited to 'examples/quick/shapes')
-rw-r--r-- | examples/quick/shapes/content/item11.qml | 6 | ||||
-rw-r--r-- | examples/quick/shapes/content/item12.qml | 6 | ||||
-rw-r--r-- | examples/quick/shapes/content/item5.qml | 12 |
3 files changed, 12 insertions, 12 deletions
diff --git a/examples/quick/shapes/content/item11.qml b/examples/quick/shapes/content/item11.qml index 21687d42f1..0cfe73d5c9 100644 --- a/examples/quick/shapes/content/item11.qml +++ b/examples/quick/shapes/content/item11.qml @@ -60,10 +60,10 @@ Rectangle { anchors.centerIn: parent ShapePath { - fillGradient: ShapeLinearGradient { + fillGradient: LinearGradient { y2: shape.height - ShapeGradientStop { position: 0; color: "yellow" } - ShapeGradientStop { position: 1; color: "green" } + GradientStop { position: 0; color: "yellow" } + GradientStop { position: 1; color: "green" } } startX: 10; startY: 100 diff --git a/examples/quick/shapes/content/item12.qml b/examples/quick/shapes/content/item12.qml index d4d7816e44..8bdd1bfe50 100644 --- a/examples/quick/shapes/content/item12.qml +++ b/examples/quick/shapes/content/item12.qml @@ -65,11 +65,11 @@ Rectangle { ShapePath { strokeColor: "transparent" - fillGradient: ShapeLinearGradient { + fillGradient: LinearGradient { id: grad y1: 50; y2: 150 - ShapeGradientStop { position: 0; color: "black" } - ShapeGradientStop { position: 1; color: "red" } + GradientStop { position: 0; color: "black" } + GradientStop { position: 1; color: "red" } } startX: 10; startY: 10 diff --git a/examples/quick/shapes/content/item5.qml b/examples/quick/shapes/content/item5.qml index c9874e5ebc..5fd25093ae 100644 --- a/examples/quick/shapes/content/item5.qml +++ b/examples/quick/shapes/content/item5.qml @@ -60,14 +60,14 @@ Rectangle { ShapePath { strokeWidth: 4 strokeColor: "red" - fillGradient: ShapeLinearGradient { + fillGradient: LinearGradient { x1: 20; y1: 20 x2: 180; y2: 130 - ShapeGradientStop { position: 0; color: "blue" } - ShapeGradientStop { position: 0.2; color: "green" } - ShapeGradientStop { position: 0.4; color: "red" } - ShapeGradientStop { position: 0.6; color: "yellow" } - ShapeGradientStop { position: 1; color: "cyan" } + GradientStop { position: 0; color: "blue" } + GradientStop { position: 0.2; color: "green" } + GradientStop { position: 0.4; color: "red" } + GradientStop { position: 0.6; color: "yellow" } + GradientStop { position: 1; color: "cyan" } } fillColor: "blue" // ignored with the gradient set strokeStyle: ShapePath.DashLine |