diff options
Diffstat (limited to 'examples/quick/shapes/linearGradient.qml')
-rw-r--r-- | examples/quick/shapes/linearGradient.qml | 51 |
1 files changed, 27 insertions, 24 deletions
diff --git a/examples/quick/shapes/linearGradient.qml b/examples/quick/shapes/linearGradient.qml index c427e35c38..9ac48187ff 100644 --- a/examples/quick/shapes/linearGradient.qml +++ b/examples/quick/shapes/linearGradient.qml @@ -56,32 +56,35 @@ Rectangle { width: 256 height: 256 Shape { - id: shape - anchors.fill: parent - + width: 200 + height: 150 + anchors.centerIn: parent ShapePath { - id: p - strokeWidth: 5 - strokeColor: "blue" - strokeStyle: ShapePath.DashLine - dashPattern: [ 1, 4, 4, 4 ] - fillColor: "lightBlue" - - property real xr: 70 - property real yr: 30 - startX: shape.width / 2 - xr - startY: shape.height / 2 - yr - PathArc { - x: shape.width / 2 + p.xr - y: shape.height / 2 + p.yr - radiusX: p.xr; radiusY: p.yr - useLargeArc: true + strokeWidth: 4 + strokeColor: "red" + fillGradient: LinearGradient { + x1: 20; y1: 20 + x2: 180; y2: 130 + 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" } } - PathArc { - x: shape.width / 2 - p.xr - y: shape.height / 2 - p.yr - radiusX: p.xr; radiusY: p.yr - useLargeArc: true + fillColor: "blue" // ignored with the gradient set + strokeStyle: ShapePath.DashLine + dashPattern: [ 1, 4 ] + startX: 20; startY: 20 + PathLine { x: 180; y: 130 } + PathLine { x: 20; y: 130 } + PathLine { x: 20; y: 20 } + } + transform: Rotation { origin.x: 100; origin.y: 50; axis { x: 0; y: 1; z: 0 } + SequentialAnimation on angle { + NumberAnimation { from: 0; to: 75; duration: 2000 } + NumberAnimation { from: 75; to: -75; duration: 4000 } + NumberAnimation { from: -75; to: 0; duration: 2000 } + loops: Animation.Infinite } } } |