diff options
Diffstat (limited to 'examples/quick/pathitem/content/item12.qml')
-rw-r--r-- | examples/quick/pathitem/content/item12.qml | 58 |
1 files changed, 32 insertions, 26 deletions
diff --git a/examples/quick/pathitem/content/item12.qml b/examples/quick/pathitem/content/item12.qml index 91ab9c1417..e64a2306cf 100644 --- a/examples/quick/pathitem/content/item12.qml +++ b/examples/quick/pathitem/content/item12.qml @@ -61,39 +61,45 @@ Rectangle { PathItem { anchors.fill: parent - strokeColor: "transparent" + VisualPath { + strokeColor: "transparent" - fillGradient: PathLinearGradient { - id: grad - y1: 50; y2: 150 - PathGradientStop { position: 0; color: "black" } - PathGradientStop { position: 1; color: "red" } - } - Timer { - id: spreadTimer - interval: 3000 - running: true - repeat: true - property variant spreads: [ PathGradient.PadSpread, PathGradient.RepeatSpread, PathGradient.ReflectSpread ] - property variant spreadTexts: [ "PadSpread", "RepeatSpread", "ReflectSpread" ] - property int spreadIdx: 0 - onTriggered: { spreadIdx = (spreadIdx + 1) % spreads.length; grad.spread = spreads[spreadIdx] } - } + fillGradient: PathLinearGradient { + id: grad + y1: 50; y2: 150 + PathGradientStop { position: 0; color: "black" } + PathGradientStop { position: 1; color: "red" } + } - path: Path { - startX: 10; startY: 10 - PathLine { relativeX: 180; relativeY: 0 } - PathLine { relativeX: 0; relativeY: 180 } - PathLine { relativeX: -180; relativeY: 0 } - PathLine { relativeX: 0; relativeY: -180 } + Path { + startX: 10; startY: 10 + PathLine { relativeX: 180; relativeY: 0 } + PathLine { relativeX: 0; relativeY: 180 } + PathLine { relativeX: -180; relativeY: 0 } + PathLine { relativeX: 0; relativeY: -180 } + } } + } - PathItem { - anchors.fill: parent + Timer { + id: spreadTimer + interval: 3000 + running: true + repeat: true + property variant spreads: [ PathGradient.PadSpread, PathGradient.RepeatSpread, PathGradient.ReflectSpread ] + property variant spreadTexts: [ "PadSpread", "RepeatSpread", "ReflectSpread" ] + property int spreadIdx: 0 + onTriggered: { spreadIdx = (spreadIdx + 1) % spreads.length; grad.spread = spreads[spreadIdx] } + } + + + PathItem { + anchors.fill: parent + VisualPath { strokeColor: "gray" strokeWidth: 2 fillColor: "transparent" - path: Path { + Path { PathMove { x: 0; y: 50 } PathLine { relativeX: 200; relativeY: 0 } PathMove { x: 0; y: 150 } |