diff options
Diffstat (limited to 'tests/baseline/scenegraph/data/shape')
34 files changed, 3519 insertions, 433 deletions
diff --git a/tests/baseline/scenegraph/data/shape/OrderedPaths.qml b/tests/baseline/scenegraph/data/shape/OrderedPaths.qml new file mode 100644 index 0000000000..688fbfdb59 --- /dev/null +++ b/tests/baseline/scenegraph/data/shape/OrderedPaths.qml @@ -0,0 +1,141 @@ +import QtQuick +import QtQuick.Shapes + +Item { + id: root + property bool async: false + + property int counter: 0 + NumberAnimation { + target: root + property: "counter" + duration: 2000 + from: 0 + to: 15 + running: true + } + + component RectStack : Shape { + asynchronous: root.async + + property alias p1FillColor: p1.fillColor + property alias p2FillColor: p2.fillColor + property alias p3FillColor: p3.fillColor + property alias p4FillColor: p4.fillColor + property alias p1StrokeColor: p1.strokeColor + property alias p2StrokeColor: p2.strokeColor + property alias p3StrokeColor: p3.strokeColor + property alias p4StrokeColor: p4.strokeColor + + ShapePath { + id: p1 + fillColor: "black" + strokeColor: "transparent" + strokeWidth: 5 + startX: 10 + startY: 10 + PathLine { relativeX: 100; relativeY: 0 } + PathLine { relativeX: 0; relativeY: 60 } + PathLine { relativeX: -100; relativeY: 0 } + PathLine { relativeX: 0; relativeY: -60 } + } + ShapePath { + id: p2 + fillColor: "red" + strokeColor: "transparent" + strokeWidth: 5 + startX: 20 + startY: 15 + PathLine { relativeX: 100; relativeY: 0 } + PathLine { relativeX: 0; relativeY: 60 } + PathLine { relativeX: -100; relativeY: 0 } + PathLine { relativeX: 0; relativeY: -60 } + } + ShapePath { + id: p3 + fillColor: "green" + strokeColor: "transparent" + strokeWidth: 5 + startX: 30 + startY: 20 + PathLine { relativeX: 100; relativeY: 0 } + PathLine { relativeX: 0; relativeY: 60 } + PathLine { relativeX: -100; relativeY: 0 } + PathLine { relativeX: 0; relativeY: -60 } + } + ShapePath { + id: p4 + fillColor: "blue" + strokeColor: "transparent" + strokeWidth: 5 + startX: 40 + startY: 25 + PathLine { relativeX: 100; relativeY: 0 } + PathLine { relativeX: 0; relativeY: 60 } + PathLine { relativeX: -100; relativeY: 0 } + PathLine { relativeX: 0; relativeY: -60 } + } + } + + + ListModel { + id: renderers + ListElement { renderer: Shape.GeometryRenderer } + ListElement { renderer: Shape.CurveRenderer } + } + + Row { + spacing: 5 + Repeater { + model: renderers + Column { + spacing: 5 + + RectStack { + preferredRendererType: renderer + } + + RectStack { + preferredRendererType: renderer + p1FillColor: counter % 16 >= 8 ? "black" : "transparent" + p2FillColor: counter % 8 >= 4 ? "red" : "transparent" + p3FillColor: counter % 4 >= 2 ? "green" : "transparent" + p4FillColor: counter % 2 >= 1 ? "blue" : "transparent" + } + + RectStack { + preferredRendererType: renderer + property int shifter: counter < 4 ? counter : counter + 1 + p1FillColor: shifter % 2 == 0 ? "black" : "transparent" + p2FillColor: counter % 2 == 0 ? "red" : "transparent" + p3FillColor: shifter % 2 == 1 ? "green" : "transparent" + p4FillColor: counter % 2 == 1 ? "blue" : "transparent" + } + + RectStack { + preferredRendererType: renderer + p1FillColor: counter % 16 >= 8 ? "black" : "transparent" + p2FillColor: counter % 8 >= 4 ? "red" : "transparent" + p3FillColor: counter % 4 >= 2 ? "green" : "transparent" + p4FillColor: counter % 2 >= 1 ? "blue" : "transparent" + p1StrokeColor: counter % 2 >= 1 ? "transparent" : "lightblue" + p2StrokeColor: counter % 4 >= 2 ? "transparent" : "lightgreen" + p3StrokeColor: counter % 8 >= 4 ? "transparent" : "pink" + p4StrokeColor: counter % 16 >= 8 ? "transparent" : "gray" + } + + RectStack { + preferredRendererType: renderer + p1FillColor: "transparent" + p2FillColor: "transparent" + p3FillColor: "transparent" + p4FillColor: "transparent" + p1StrokeColor: counter % 16 >= 8 ? "lightblue": "transparent" + p2StrokeColor: counter % 8 >= 4 ? "lightgreen": "transparent" + p3StrokeColor: counter % 4 >= 2 ? "pink": "transparent" + p4StrokeColor: counter % 2 >= 1 ? "gray" : "transparent" + } + } + } + } +} diff --git a/tests/baseline/scenegraph/data/shape/shape_alignment.qml b/tests/baseline/scenegraph/data/shape/shape_alignment.qml new file mode 100644 index 0000000000..6a46c9b692 --- /dev/null +++ b/tests/baseline/scenegraph/data/shape/shape_alignment.qml @@ -0,0 +1,90 @@ +import QtQuick +import QtQuick.Shapes + +Item { + width: 400 + height: 600 + + ListModel { + id: renderers + ListElement { renderer: Shape.GeometryRenderer } + ListElement { renderer: Shape.CurveRenderer } + } + + component ExampleShape : Shape { + anchors.fill: parent + preferredRendererType: renderer + ShapePath { + strokeWidth: 4 + strokeColor: "black" + fillColor: "gray" + + startX: 0; startY: 0 + PathLine { x: 100; y: 0 } + PathLine { x: 100; y: 30 } + PathLine { x: 0; y: 30 } + PathLine { x: 0; y: 0 } + } + ShapePath { + strokeWidth: 2 + strokeColor: "yellow" + fillColor: "transparent" + startX: 0; startY: 0 + PathLine { x: 100; y: 30 } + } + z: -1 + } + + component ParentRect: Rectangle { + width: 150 + height: 100 + color: "transparent" + border.color: "blue" + border.width: 2 + radius: 10 + } + + Row { + x: 10 + y: 10 + spacing: 20 + Repeater { + model: renderers + Column { + spacing: 10 + ParentRect { + ExampleShape { + } + } + ParentRect { + ExampleShape { + horizontalAlignment: Shape.AlignHCenter + verticalAlignment: Shape.AlignBottom + } + } + ParentRect { + ExampleShape { + horizontalAlignment: Shape.AlignHCenter + verticalAlignment: Shape.AlignVCenter + fillMode: Shape.PreserveAspectFit + } + } + ParentRect { + clip: true + ExampleShape { + horizontalAlignment: Shape.AlignHCenter + verticalAlignment: Shape.AlignVCenter + fillMode: Shape.PreserveAspectCrop + } + } + ParentRect { + ExampleShape { + horizontalAlignment: Shape.AlignHCenter + verticalAlignment: Shape.AlignBottom + fillMode: Shape.Stretch + } + } + } + } + } +} diff --git a/tests/baseline/scenegraph/data/shape/shape_arc.qml b/tests/baseline/scenegraph/data/shape/shape_arc.qml index 0b2396012e..7a767ab07a 100644 --- a/tests/baseline/scenegraph/data/shape/shape_arc.qml +++ b/tests/baseline/scenegraph/data/shape/shape_arc.qml @@ -1,108 +1,119 @@ import QtQuick 2.9 -import QtQuick.Shapes 1.0 +import QtQuick.Shapes 6.6 Item { width: 320 height: 480 - Column { - Item { - width: 200 - height: 100 - - Repeater { - model: 2 - Shape { - anchors.fill: parent - vendorExtensionsEnabled: false - - ShapePath { - fillColor: "transparent" - strokeColor: model.index === 0 ? "red" : "blue" - strokeStyle: ShapePath.DashLine - strokeWidth: 4 - - startX: 4; startY: 4 - PathArc { - id: arc - x: 96; y: 96 - radiusX: 100; radiusY: 100 - direction: model.index === 0 ? PathArc.Clockwise : PathArc.Counterclockwise + ListModel { + id: renderers + ListElement { renderer: Shape.GeometryRenderer } + ListElement { renderer: Shape.CurveRenderer } + } + + Row { + Repeater { + model: renderers + Column { + Item { + width: 160 + height: 100 + + Repeater { + model: 2 + Shape { + anchors.fill: parent + preferredRendererType: renderer + + ShapePath { + fillColor: "transparent" + strokeColor: model.index === 0 ? "red" : "blue" + strokeStyle: ShapePath.DashLine + strokeWidth: 4 + + startX: 4; startY: 4 + PathArc { + id: arc + x: 96; y: 96 + radiusX: 100; radiusY: 100 + direction: model.index === 0 ? PathArc.Clockwise : PathArc.Counterclockwise + } + } } } } - } - } - Item { - width: 200 - height: 100 - - Repeater { - model: 2 - Shape { - anchors.fill: parent - vendorExtensionsEnabled: false - - ShapePath { - fillColor: "transparent" - strokeColor: model.index === 0 ? "red" : "blue" - strokeStyle: ShapePath.DashLine - strokeWidth: 4 - - startX: 50; startY: 100 - PathArc { - x: 100; y: 150 - radiusX: 50; radiusY: 50 - useLargeArc: model.index === 1 + Item { + width: 160 + height: 100 + + Repeater { + model: 2 + Shape { + anchors.fill: parent + preferredRendererType: renderer + + ShapePath { + fillColor: "transparent" + strokeColor: model.index === 0 ? "red" : "blue" + strokeStyle: ShapePath.DashLine + strokeWidth: 4 + + startX: 10; startY: 100 + PathArc { + x: 60; y: 150 + radiusX: 50; radiusY: 50 + useLargeArc: model.index === 1 + } + } } } } - } - } - Item { - width: 200 - height: 100 - - Repeater { - model: 2 - Shape { - anchors.fill: parent - vendorExtensionsEnabled: false - - ShapePath { - fillColor: "transparent" - strokeColor: model.index === 0 ? "red" : "blue" - strokeStyle: ShapePath.DashLine - strokeWidth: 4 - - startX: 50; startY: 150 - PathArc { - x: 150; y: 150 - radiusX: 50; radiusY: 20 - xAxisRotation: model.index === 0 ? 0 : 45 + Item { + width: 160 + height: 100 + + Repeater { + model: 2 + Shape { + anchors.fill: parent + preferredRendererType: renderer + + ShapePath { + fillColor: "transparent" + strokeColor: model.index === 0 ? "red" : "blue" + strokeStyle: ShapePath.DashLine + strokeWidth: 4 + + startX: 30; startY: 150 + PathArc { + x: 130; y: 150 + radiusX: 50; radiusY: 20 + xAxisRotation: model.index === 0 ? 0 : 45 + } + } } } - } - } - Repeater { - model: 2 - Shape { - anchors.fill: parent - vendorExtensionsEnabled: false - - ShapePath { - fillColor: "transparent" - strokeColor: model.index === 0 ? "red" : "blue" - - startX: 50; startY: 150 - PathArc { - x: 150; y: 150 - radiusX: 50; radiusY: 20 - xAxisRotation: model.index === 0 ? 0 : 45 - direction: PathArc.Counterclockwise + Repeater { + model: 2 + Shape { + anchors.fill: parent + preferredRendererType: renderer + + ShapePath { + fillColor: "transparent" + strokeColor: model.index === 0 ? "red" : "blue" + + startX: 30; startY: 150 + PathArc { + x: 130; y: 150 + radiusX: 50; radiusY: 20 + xAxisRotation: model.index === 0 ? 0 : 45 + direction: PathArc.Counterclockwise + } + } } } } diff --git a/tests/baseline/scenegraph/data/shape/shape_arc_fill.qml b/tests/baseline/scenegraph/data/shape/shape_arc_fill.qml index fefc2ec3eb..f822d6b53f 100644 --- a/tests/baseline/scenegraph/data/shape/shape_arc_fill.qml +++ b/tests/baseline/scenegraph/data/shape/shape_arc_fill.qml @@ -1,108 +1,119 @@ import QtQuick 2.9 -import QtQuick.Shapes 1.0 +import QtQuick.Shapes 6.6 Item { width: 320 height: 480 - Column { - Item { - width: 200 - height: 100 - - Repeater { - model: 2 - Shape { - anchors.fill: parent - vendorExtensionsEnabled: false - - ShapePath { - fillColor: "lightBlue" - strokeColor: model.index === 0 ? "red" : "blue" - strokeStyle: ShapePath.DashLine - strokeWidth: 4 - - startX: 4; startY: 4 - PathArc { - id: arc - x: 96; y: 96 - radiusX: 100; radiusY: 100 - direction: model.index === 0 ? PathArc.Clockwise : PathArc.Counterclockwise + ListModel { + id: renderers + ListElement { renderer: Shape.GeometryRenderer } + ListElement { renderer: Shape.CurveRenderer } + } + + Row { + Repeater { + model: renderers + Column { + Item { + width: 160 + height: 100 + + Repeater { + model: 2 + Shape { + anchors.fill: parent + preferredRendererType: renderer + + ShapePath { + fillColor: "lightBlue" + strokeColor: model.index === 0 ? "red" : "blue" + strokeStyle: ShapePath.DashLine + strokeWidth: 4 + + startX: 4; startY: 4 + PathArc { + id: arc + x: 96; y: 96 + radiusX: 100; radiusY: 100 + direction: model.index === 0 ? PathArc.Clockwise : PathArc.Counterclockwise + } + } } } } - } - } - Item { - width: 200 - height: 100 - - Repeater { - model: 2 - Shape { - anchors.fill: parent - vendorExtensionsEnabled: false - - ShapePath { - fillColor: "green" - strokeColor: model.index === 0 ? "red" : "blue" - strokeStyle: ShapePath.DashLine - strokeWidth: 4 - - startX: 50; startY: 100 - PathArc { - x: 100; y: 150 - radiusX: 50; radiusY: 50 - useLargeArc: model.index === 1 + Item { + width: 160 + height: 100 + + Repeater { + model: 2 + Shape { + anchors.fill: parent + preferredRendererType: renderer + + ShapePath { + fillColor: "green" + strokeColor: model.index === 0 ? "red" : "blue" + strokeStyle: ShapePath.DashLine + strokeWidth: 4 + + startX: 10; startY: 100 + PathArc { + x: 60; y: 150 + radiusX: 50; radiusY: 50 + useLargeArc: model.index === 1 + } + } } } } - } - } - Item { - width: 200 - height: 100 - - Repeater { - model: 2 - Shape { - anchors.fill: parent - vendorExtensionsEnabled: false - - ShapePath { - fillColor: "gray" - strokeColor: model.index === 0 ? "red" : "blue" - strokeStyle: ShapePath.DashLine - strokeWidth: 4 - - startX: 50; startY: 150 - PathArc { - x: 150; y: 150 - radiusX: 50; radiusY: 20 - xAxisRotation: model.index === 0 ? 0 : 45 + Item { + width: 160 + height: 100 + + Repeater { + model: 2 + Shape { + anchors.fill: parent + preferredRendererType: renderer + + ShapePath { + fillColor: "gray" + strokeColor: model.index === 0 ? "red" : "blue" + strokeStyle: ShapePath.DashLine + strokeWidth: 4 + + startX: 30; startY: 150 + PathArc { + x: 130; y: 150 + radiusX: 50; radiusY: 20 + xAxisRotation: model.index === 0 ? 0 : 45 + } + } } } - } - } - Repeater { - model: 2 - Shape { - anchors.fill: parent - vendorExtensionsEnabled: false - - ShapePath { - fillColor: "lightGray" - strokeColor: model.index === 0 ? "red" : "blue" - - startX: 50; startY: 150 - PathArc { - x: 150; y: 150 - radiusX: 50; radiusY: 20 - xAxisRotation: model.index === 0 ? 0 : 45 - direction: PathArc.Counterclockwise + Repeater { + model: 2 + Shape { + anchors.fill: parent + preferredRendererType: renderer + + ShapePath { + fillColor: "lightGray" + strokeColor: model.index === 0 ? "red" : "blue" + + startX: 30; startY: 150 + PathArc { + x: 130; y: 150 + radiusX: 50; radiusY: 20 + xAxisRotation: model.index === 0 ? 0 : 45 + direction: PathArc.Counterclockwise + } + } } } } diff --git a/tests/baseline/scenegraph/data/shape/shape_boundingrect.qml b/tests/baseline/scenegraph/data/shape/shape_boundingrect.qml new file mode 100644 index 0000000000..e82c4d3b2b --- /dev/null +++ b/tests/baseline/scenegraph/data/shape/shape_boundingrect.qml @@ -0,0 +1,46 @@ +import QtQuick +import QtQuick.Shapes + +Item { + width: 620 + height: 400 + transformOrigin: Item.TopLeft + + + property var svgPaths: [ + "M 0 25 L 200 25", + "M 0 0 L 215 125", + "M 0 0 L 175 175", + "M 100 0 Q 200 0 200 75 Q 200 150 100 150 Q 0 150 0 75 Q 0 0 100 0 z", + "M 50 0 L 50 150" + ] + + Flow { + anchors.fill: parent + padding: 25 + spacing: 25 + Repeater { + model: svgPaths + Shape { + preferredRendererType: Shape.CurveRenderer + ShapePath { + strokeColor: "red" + strokeWidth: 22 + fillColor: "gray" + capStyle: ShapePath.RoundCap + PathSvg { path: modelData } + } + Rectangle { + color: "transparent" + border.color: "blue" + border.width: 2 + x: parent.boundingRect.x + y: parent.boundingRect.y + width: parent.boundingRect.width + height: parent.boundingRect.height + } + } +} + + } +} diff --git a/tests/baseline/scenegraph/data/shape/shape_boundingrect_square_cap.qml b/tests/baseline/scenegraph/data/shape/shape_boundingrect_square_cap.qml new file mode 100644 index 0000000000..d4c714cb86 --- /dev/null +++ b/tests/baseline/scenegraph/data/shape/shape_boundingrect_square_cap.qml @@ -0,0 +1,45 @@ +import QtQuick +import QtQuick.Shapes + +Item { + width: 620 + height: 400 + transformOrigin: Item.TopLeft + + property var svgPaths: [ + "M 0 25 L 200 25", + "M 0 0 L 215 125", + "M 0 0 L 175 175", + "M 100 0 Q 200 0 200 75 Q 200 150 100 150 Q 0 150 0 75 Q 0 0 100 0 z", + "M 50 0 L 50 150" + ] + + Flow { + anchors.fill: parent + padding: 25 + spacing: 25 + Repeater { + model: svgPaths + Shape { + preferredRendererType: Shape.CurveRenderer + ShapePath { + strokeColor: "red" + strokeWidth: 22 + fillColor: "gray" + capStyle: ShapePath.SquareCap + PathSvg { path: modelData } + } + Rectangle { + color: "transparent" + border.color: "blue" + border.width: 2 + x: parent.boundingRect.x + y: parent.boundingRect.y + width: parent.boundingRect.width + height: parent.boundingRect.height + } + } + } + + } +} diff --git a/tests/baseline/scenegraph/data/shape/shape_cubic.qml b/tests/baseline/scenegraph/data/shape/shape_cubic.qml index 1d2f9fd40d..8db08b4268 100644 --- a/tests/baseline/scenegraph/data/shape/shape_cubic.qml +++ b/tests/baseline/scenegraph/data/shape/shape_cubic.qml @@ -1,31 +1,42 @@ import QtQuick 2.9 -import QtQuick.Shapes 1.0 +import QtQuick.Shapes 6.6 Item { width: 320 height: 480 - Column { + ListModel { + id: renderers + ListElement { renderer: Shape.GeometryRenderer } + ListElement { renderer: Shape.CurveRenderer } + } + + Row { Repeater { - model: 4 - Item { - width: 200 - height: 100 + model: renderers + Column { + Repeater { + model: 4 + Item { + width: 160 + height: 100 - Shape { - anchors.fill: parent - vendorExtensionsEnabled: false + Shape { + anchors.fill: parent + preferredRendererType: renderer - ShapePath { - strokeWidth: (model.index + 2) * 2 - strokeColor: "black" - fillColor: "lightBlue" + ShapePath { + strokeWidth: (model.index + 2) * 2 + strokeColor: "black" + fillColor: "lightBlue" - startX: 50; startY: 100 - PathCubic { - x: 150; y: 100 - control1X: model.index * 10; control1Y: model.index * 5 - control2X: model.index * -10; control2Y: model.index * 10 + startX: 30; startY: 100 + PathCubic { + x: 130; y: 100 + control1X: model.index * 10; control1Y: model.index * 5 + control2X: model.index * -10; control2Y: model.index * 10 + } + } } } } diff --git a/tests/baseline/scenegraph/data/shape/shape_dashcurves.qml b/tests/baseline/scenegraph/data/shape/shape_dashcurves.qml new file mode 100644 index 0000000000..f4f0ca72ea --- /dev/null +++ b/tests/baseline/scenegraph/data/shape/shape_dashcurves.qml @@ -0,0 +1,547 @@ +import QtQuick 2.9 +import QtQuick.Shapes 6.6 + +Item { + id: root + width: 320 + height: 480 + + ListModel { + id: renderers + ListElement { renderer: Shape.GeometryRenderer } + ListElement { renderer: Shape.CurveRenderer } + } + + Row { + Repeater { + model: renderers + Item { + width: root.width / 2 + height: root.height + + Rectangle { + x: 10 + y: 5 + width : 140 + height: 470 + color: "yellow" + } + + Shape { + anchors.fill: parent + preferredRendererType: renderer + + ShapePath { + startY: 5 + strokeWidth: 1 + dashOffset: 0 + strokeColor: "blue" + fillColor: "transparent" + startX: 10 + strokeStyle: ShapePath.DashLine + PathQuad { relativeControlX: 30; relativeControlY: 30; relativeX: 140; relativeY: 0 } + } + + ShapePath { + startY: 10.5 + strokeWidth: 1 + dashOffset: 0 + strokeColor: "blue" + fillColor: "transparent" + startX: 10 + strokeStyle: ShapePath.DashLine + PathQuad { relativeControlX: 30; relativeControlY: 30; relativeX: 140; relativeY: 0 } + } + + ShapePath { + startY: 15 + strokeWidth: 1 + dashOffset: 0 + capStyle: ShapePath.FlatCap + strokeColor: "blue" + fillColor: "transparent" + startX: 10 + strokeStyle: ShapePath.DashLine + PathQuad { relativeControlX: 30; relativeControlY: 30; relativeX: 140; relativeY: 0 } + } + + ShapePath { + startY: 20 + strokeWidth: 3 + dashOffset: 0 + strokeColor: "blue" + fillColor: "transparent" + startX: 10 + strokeStyle: ShapePath.DashLine + PathQuad { relativeControlX: 30; relativeControlY: 30; relativeX: 140; relativeY: 0 } + } + + ShapePath { + startY: 25 + strokeWidth: 3 + dashOffset: 0 + capStyle: ShapePath.RoundCap + strokeColor: "blue" + fillColor: "transparent" + startX: 10 + strokeStyle: ShapePath.DashLine + PathQuad { relativeControlX: 30; relativeControlY: 30; relativeX: 140; relativeY: 0 } + } + + ShapePath { + startY: 30 + strokeWidth: 3 + dashOffset: 0 + capStyle: ShapePath.FlatCap + strokeColor: "blue" + fillColor: "transparent" + startX: 10 + strokeStyle: ShapePath.DashLine + PathQuad { relativeControlX: 30; relativeControlY: 30; relativeX: 140; relativeY: 0 } + } + + ShapePath { + startY: 40 + strokeWidth: 3 + dashOffset: 0.5 + capStyle: ShapePath.RoundCap + strokeColor: "blue" + fillColor: "transparent" + startX: 10 + strokeStyle: ShapePath.DashLine + PathQuad { relativeControlX: 30; relativeControlY: 30; relativeX: 140; relativeY: 0 } + } + + ShapePath { + startY: 45 + strokeWidth: 3 + dashOffset: 2 + capStyle: ShapePath.RoundCap + strokeColor: "blue" + fillColor: "transparent" + startX: 10 + strokeStyle: ShapePath.DashLine + PathQuad { relativeControlX: 30; relativeControlY: 30; relativeX: 140; relativeY: 0 } + } + + ShapePath { + startY: 50 + strokeWidth: 3 + dashOffset: 4 + capStyle: ShapePath.RoundCap + strokeColor: "blue" + fillColor: "transparent" + startX: 10 + strokeStyle: ShapePath.DashLine + PathQuad { relativeControlX: 30; relativeControlY: 30; relativeX: 140; relativeY: 0 } + } + + ShapePath { + startY: 55 + strokeWidth: 3 + dashOffset: 100.7 + capStyle: ShapePath.RoundCap + strokeColor: "blue" + fillColor: "transparent" + startX: 10 + strokeStyle: ShapePath.DashLine + PathQuad { relativeControlX: 30; relativeControlY: 30; relativeX: 140; relativeY: 0 } + } + + ShapePath { + startY: 60 + strokeWidth: 3 + dashOffset: 0 + capStyle: ShapePath.FlatCap + strokeColor: "blue" + fillColor: "transparent" + startX: 10 + strokeStyle: ShapePath.DashLine + PathQuad { relativeControlX: 30; relativeControlY: 30; relativeX: 140; relativeY: 0 } + } + + ShapePath { + startY: 65 + strokeWidth: 3 + dashOffset: 6 + capStyle: ShapePath.FlatCap + strokeColor: "blue" + fillColor: "transparent" + startX: 10 + strokeStyle: ShapePath.DashLine + PathQuad { relativeControlX: 30; relativeControlY: 30; relativeX: 140; relativeY: 0 } + } + + ShapePath { + startY: 70 + strokeWidth: 3 + dashOffset: -6 + capStyle: ShapePath.FlatCap + strokeColor: "blue" + fillColor: "transparent" + startX: 10 + strokeStyle: ShapePath.DashLine + PathQuad { relativeControlX: 30; relativeControlY: 30; relativeX: 140; relativeY: 0 } + } + + ShapePath { + startY: 75 + strokeWidth: 3 + dashOffset: -2.5 + capStyle: ShapePath.FlatCap + strokeColor: "blue" + fillColor: "transparent" + startX: 10 + strokeStyle: ShapePath.DashLine + PathQuad { relativeControlX: 30; relativeControlY: 30; relativeX: 140; relativeY: 0 } + } + + ShapePath { + startY: 85 + strokeWidth: 3 + dashPattern: [1, 1] + capStyle: ShapePath.FlatCap + strokeColor: "blue" + fillColor: "transparent" + startX: 10 + strokeStyle: ShapePath.DashLine + PathQuad { relativeControlX: 30; relativeControlY: 30; relativeX: 140; relativeY: 0 } + } + + ShapePath { + startY: 90 + strokeWidth: 3 + dashPattern: [1.3, 1] + capStyle: ShapePath.FlatCap + strokeColor: "blue" + fillColor: "transparent" + startX: 10 + strokeStyle: ShapePath.DashLine + PathQuad { relativeControlX: 30; relativeControlY: 30; relativeX: 140; relativeY: 0 } + } + + ShapePath { + startY: 95 + strokeWidth: 3 + dashPattern: [1, 2] + capStyle: ShapePath.FlatCap + strokeColor: "blue" + fillColor: "transparent" + startX: 10 + strokeStyle: ShapePath.DashLine + PathQuad { relativeControlX: 30; relativeControlY: 30; relativeX: 140; relativeY: 0 } + } + + ShapePath { + startY: 100 + strokeWidth: 3 + dashPattern: [2, 1] + capStyle: ShapePath.FlatCap + strokeColor: "blue" + fillColor: "transparent" + startX: 10 + strokeStyle: ShapePath.DashLine + PathQuad { relativeControlX: 30; relativeControlY: 30; relativeX: 140; relativeY: 0 } + } + + ShapePath { + startY: 105 + strokeWidth: 3 + dashPattern: [2, 2] + capStyle: ShapePath.FlatCap + strokeColor: "blue" + fillColor: "transparent" + startX: 10 + strokeStyle: ShapePath.DashLine + PathQuad { relativeControlX: 30; relativeControlY: 30; relativeX: 140; relativeY: 0 } + } + + ShapePath { + startY: 110 + strokeWidth: 3 + dashPattern: [4, 2, 2, 3, 5, 1] + capStyle: ShapePath.FlatCap + strokeColor: "blue" + fillColor: "transparent" + startX: 10 + strokeStyle: ShapePath.DashLine + PathQuad { relativeControlX: 30; relativeControlY: 30; relativeX: 140; relativeY: 0 } + } + + ShapePath { + startY: 115 + strokeWidth: 3 + dashPattern: [1, 2, 3, 4] + capStyle: ShapePath.FlatCap + strokeColor: "blue" + fillColor: "transparent" + startX: 10 + strokeStyle: ShapePath.DashLine + PathQuad { relativeControlX: 30; relativeControlY: 30; relativeX: 140; relativeY: 0 } + } + + ShapePath { + startY: 120 + strokeWidth: 3 + dashPattern: [1, 2, 3, 4] + dashOffset: 1 + capStyle: ShapePath.FlatCap + strokeColor: "blue" + fillColor: "transparent" + startX: 10 + strokeStyle: ShapePath.DashLine + PathQuad { relativeControlX: 30; relativeControlY: 30; relativeX: 140; relativeY: 0 } + } + + ShapePath { + startY: 125 + strokeWidth: 3 + dashPattern: [1, 2, 3, 4] + dashOffset: 3 + capStyle: ShapePath.FlatCap + strokeColor: "blue" + fillColor: "transparent" + startX: 10 + strokeStyle: ShapePath.DashLine + PathQuad { relativeControlX: 30; relativeControlY: 30; relativeX: 140; relativeY: 0 } + } + + ShapePath { + startY: 130 + strokeWidth: 3 + dashPattern: [1, 2, 3, 4] + dashOffset: 6 + capStyle: ShapePath.FlatCap + strokeColor: "blue" + fillColor: "transparent" + startX: 10 + strokeStyle: ShapePath.DashLine + PathQuad { relativeControlX: 30; relativeControlY: 30; relativeX: 140; relativeY: 0 } + } + + ShapePath { + startY: 135 + strokeWidth: 3 + dashPattern: [1, 2, 3, 4] + dashOffset: 10 + capStyle: ShapePath.FlatCap + strokeColor: "blue" + fillColor: "transparent" + startX: 10 + strokeStyle: ShapePath.DashLine + PathQuad { relativeControlX: 30; relativeControlY: 30; relativeX: 140; relativeY: 0 } + } + + + ShapePath { + startY: 150 + strokeWidth: 7 + dashPattern: [3, 2] + capStyle: ShapePath.RoundCap + strokeColor: "blue" + fillColor: "transparent" + startX: 10 + strokeStyle: ShapePath.DashLine + PathQuad { relativeControlX: 30; relativeControlY: 30; relativeX: 140; relativeY: 0 } + } + + ShapePath { + startY: 160 + strokeWidth: 7 + dashPattern: [3, 1.5] + capStyle: ShapePath.RoundCap + strokeColor: "blue" + fillColor: "transparent" + startX: 10 + strokeStyle: ShapePath.DashLine + PathQuad { relativeControlX: 30; relativeControlY: 30; relativeX: 140; relativeY: 0 } + } + + ShapePath { + startY: 170 + strokeWidth: 7 + dashPattern: [3, 1] + capStyle: ShapePath.RoundCap + strokeColor: "blue" + fillColor: "transparent" + startX: 10 + strokeStyle: ShapePath.DashLine + PathQuad { relativeControlX: 30; relativeControlY: 30; relativeX: 140; relativeY: 0 } + } + + ShapePath { + startY: 180 + strokeWidth: 7 + dashPattern: [3, 0.7] + capStyle: ShapePath.RoundCap + strokeColor: "blue" + fillColor: "transparent" + startX: 10 + strokeStyle: ShapePath.DashLine + PathQuad { relativeControlX: 30; relativeControlY: 30; relativeX: 140; relativeY: 0 } + } + + ShapePath { + startY: 190 + strokeWidth: 7 + dashPattern: [3, 0.2] + capStyle: ShapePath.RoundCap + strokeColor: "blue" + fillColor: "transparent" + startX: 10 + strokeStyle: ShapePath.DashLine + PathQuad { relativeControlX: 30; relativeControlY: 30; relativeX: 140; relativeY: 0 } + } + + ShapePath { + startY: 200 + strokeWidth: 7 + dashPattern: [3, 0] + capStyle: ShapePath.RoundCap + strokeColor: "blue" + fillColor: "transparent" + startX: 10 + strokeStyle: ShapePath.DashLine + PathQuad { relativeControlX: 30; relativeControlY: 30; relativeX: 140; relativeY: 0 } + } + + ShapePath { + // QTBUG-123805 + startY: 210 + strokeWidth: 5.8575662686300545; + dashPattern: [2, 2] + dashOffset: 4 + capStyle: ShapePath.FlatCap + strokeColor: "blue" + fillColor: "transparent" + startX: 10 + strokeStyle: ShapePath.DashLine + PathQuad { relativeControlX: 30; relativeControlY: 30; relativeX: 140; relativeY: 0 } + } + + ShapePath { + startY: 220 + strokeWidth: 3 + dashPattern: [3, 3, 2] + capStyle: ShapePath.FlatCap + strokeColor: "blue" + fillColor: "transparent" + startX: 10 + strokeStyle: ShapePath.DashLine + PathQuad { relativeControlX: 30; relativeControlY: 30; relativeX: 140; relativeY: 0 } + } + + ShapePath { + startY: 225 + strokeWidth: 3 + dashPattern: [0, 3, 2] + capStyle: ShapePath.FlatCap + strokeColor: "blue" + fillColor: "transparent" + startX: 10 + strokeStyle: ShapePath.DashLine + PathQuad { relativeControlX: 30; relativeControlY: 30; relativeX: 140; relativeY: 0 } + } + + ShapePath { + startY: 230 + strokeWidth: 3 + dashPattern: [-3, 3, 2] + capStyle: ShapePath.FlatCap + strokeColor: "blue" + fillColor: "transparent" + startX: 10 + strokeStyle: ShapePath.DashLine + PathQuad { relativeControlX: 30; relativeControlY: 30; relativeX: 140; relativeY: 0 } + } + + ShapePath { + startY: 235 + strokeWidth: 3 + dashPattern: [-3, 3, 2] + dashOffset: 1 + capStyle: ShapePath.FlatCap + strokeColor: "blue" + fillColor: "transparent" + startX: 10 + strokeStyle: ShapePath.DashLine + PathQuad { relativeControlX: 30; relativeControlY: 30; relativeX: 140; relativeY: 0 } + } + + ShapePath { + startY: 240 + strokeWidth: 3 + dashPattern: [-3, 3, 2] + dashOffset: -1 + capStyle: ShapePath.FlatCap + strokeColor: "blue" + fillColor: "transparent" + startX: 10 + strokeStyle: ShapePath.DashLine + PathQuad { relativeControlX: 30; relativeControlY: 30; relativeX: 140; relativeY: 0 } + } + + ShapePath { + startY: 245 + strokeWidth: 3 + dashPattern: [-5, 2] + capStyle: ShapePath.FlatCap + strokeColor: "blue" + fillColor: "transparent" + startX: 10 + strokeStyle: ShapePath.DashLine + PathQuad { relativeControlX: 30; relativeControlY: 30; relativeX: 140; relativeY: 0 } + } + + ShapePath { + startY: 250 + strokeWidth: 3 + dashPattern: [5, -2] + capStyle: ShapePath.FlatCap + strokeColor: "blue" + fillColor: "transparent" + startX: 10 + strokeStyle: ShapePath.DashLine + PathQuad { relativeControlX: 30; relativeControlY: 30; relativeX: 140; relativeY: 0 } + } + + ShapePath { + startY: 255 + strokeWidth: 3 + dashPattern: [-5, -2] + capStyle: ShapePath.FlatCap + strokeColor: "blue" + fillColor: "transparent" + startX: 10 + strokeStyle: ShapePath.DashLine + PathQuad { relativeControlX: 30; relativeControlY: 30; relativeX: 140; relativeY: 0 } + } + + ShapePath { + startY: 260 + strokeWidth: 3 + dashPattern: [-5, -2, -4] + capStyle: ShapePath.FlatCap + strokeColor: "blue" + fillColor: "transparent" + startX: 10 + strokeStyle: ShapePath.DashLine + PathQuad { relativeControlX: 30; relativeControlY: 30; relativeX: 140; relativeY: 0 } + } + + ShapePath { + startY: 265 + strokeWidth: 3 + dashPattern: [-5, -2, 4] + capStyle: ShapePath.FlatCap + strokeColor: "blue" + fillColor: "transparent" + startX: 10 + strokeStyle: ShapePath.DashLine + PathQuad { relativeControlX: 30; relativeControlY: 30; relativeX: 140; relativeY: 0 } + } + } + } + } + } +} diff --git a/tests/baseline/scenegraph/data/shape/shape_dashlines.qml b/tests/baseline/scenegraph/data/shape/shape_dashlines.qml new file mode 100644 index 0000000000..a1ea4a315e --- /dev/null +++ b/tests/baseline/scenegraph/data/shape/shape_dashlines.qml @@ -0,0 +1,505 @@ +import QtQuick 2.9 +import QtQuick.Shapes 6.6 + +Item { + id: root + width: 320 + height: 480 + + ListModel { + id: renderers + ListElement { renderer: Shape.GeometryRenderer } + ListElement { renderer: Shape.CurveRenderer } + } + + Row { + Repeater { + model: renderers + Item { + width: root.width / 2 + height: root.height + + Rectangle { + x: 10 + y: 5 + width : 140 + height: 470 + color: "yellow" + } + + Shape { + anchors.fill: parent + preferredRendererType: renderer + + ShapePath { + startY: 5 + strokeWidth: 1 + dashOffset: 0 + strokeColor: "blue" + startX: 10 + strokeStyle: ShapePath.DashLine + PathLine { relativeX: 140; relativeY: 0 } + } + + ShapePath { + startY: 10.5 + strokeWidth: 1 + dashOffset: 0 + strokeColor: "blue" + startX: 10 + strokeStyle: ShapePath.DashLine + PathLine { relativeX: 140; relativeY: 0 } + } + + ShapePath { + startY: 15 + strokeWidth: 1 + dashOffset: 0 + capStyle: ShapePath.FlatCap + strokeColor: "blue" + startX: 10 + strokeStyle: ShapePath.DashLine + PathLine { relativeX: 140; relativeY: 0 } + } + + ShapePath { + startY: 20 + strokeWidth: 3 + dashOffset: 0 + strokeColor: "blue" + startX: 10 + strokeStyle: ShapePath.DashLine + PathLine { relativeX: 140; relativeY: 0 } + } + + ShapePath { + startY: 25 + strokeWidth: 3 + dashOffset: 0 + capStyle: ShapePath.RoundCap + strokeColor: "blue" + startX: 10 + strokeStyle: ShapePath.DashLine + PathLine { relativeX: 140; relativeY: 0 } + } + + ShapePath { + startY: 30 + strokeWidth: 3 + dashOffset: 0 + capStyle: ShapePath.FlatCap + strokeColor: "blue" + startX: 10 + strokeStyle: ShapePath.DashLine + PathLine { relativeX: 140; relativeY: 0 } + } + + ShapePath { + startY: 40 + strokeWidth: 3 + dashOffset: 0.5 + capStyle: ShapePath.RoundCap + strokeColor: "blue" + startX: 10 + strokeStyle: ShapePath.DashLine + PathLine { relativeX: 140; relativeY: 0 } + } + + ShapePath { + startY: 45 + strokeWidth: 3 + dashOffset: 2 + capStyle: ShapePath.RoundCap + strokeColor: "blue" + startX: 10 + strokeStyle: ShapePath.DashLine + PathLine { relativeX: 140; relativeY: 0 } + } + + ShapePath { + startY: 50 + strokeWidth: 3 + dashOffset: 4 + capStyle: ShapePath.RoundCap + strokeColor: "blue" + startX: 10 + strokeStyle: ShapePath.DashLine + PathLine { relativeX: 140; relativeY: 0 } + } + + ShapePath { + startY: 55 + strokeWidth: 3 + dashOffset: 100.7 + capStyle: ShapePath.RoundCap + strokeColor: "blue" + startX: 10 + strokeStyle: ShapePath.DashLine + PathLine { relativeX: 140; relativeY: 0 } + } + + ShapePath { + startY: 60 + strokeWidth: 3 + dashOffset: 0 + capStyle: ShapePath.FlatCap + strokeColor: "blue" + startX: 10 + strokeStyle: ShapePath.DashLine + PathLine { relativeX: 140; relativeY: 0 } + } + + ShapePath { + startY: 65 + strokeWidth: 3 + dashOffset: 6 + capStyle: ShapePath.FlatCap + strokeColor: "blue" + startX: 10 + strokeStyle: ShapePath.DashLine + PathLine { relativeX: 140; relativeY: 0 } + } + + ShapePath { + startY: 70 + strokeWidth: 3 + dashOffset: -6 + capStyle: ShapePath.FlatCap + strokeColor: "blue" + startX: 10 + strokeStyle: ShapePath.DashLine + PathLine { relativeX: 140; relativeY: 0 } + } + + ShapePath { + startY: 75 + strokeWidth: 3 + dashOffset: -2.5 + capStyle: ShapePath.FlatCap + strokeColor: "blue" + startX: 10 + strokeStyle: ShapePath.DashLine + PathLine { relativeX: 140; relativeY: 0 } + } + + ShapePath { + startY: 85 + strokeWidth: 3 + dashPattern: [1, 1] + capStyle: ShapePath.FlatCap + strokeColor: "blue" + startX: 10 + strokeStyle: ShapePath.DashLine + PathLine { relativeX: 140; relativeY: 0 } + } + + ShapePath { + startY: 90 + strokeWidth: 3 + dashPattern: [1.3, 1] + capStyle: ShapePath.FlatCap + strokeColor: "blue" + startX: 10 + strokeStyle: ShapePath.DashLine + PathLine { relativeX: 140; relativeY: 0 } + } + + ShapePath { + startY: 95 + strokeWidth: 3 + dashPattern: [1, 2] + capStyle: ShapePath.FlatCap + strokeColor: "blue" + startX: 10 + strokeStyle: ShapePath.DashLine + PathLine { relativeX: 140; relativeY: 0 } + } + + ShapePath { + startY: 100 + strokeWidth: 3 + dashPattern: [2, 1] + capStyle: ShapePath.FlatCap + strokeColor: "blue" + startX: 10 + strokeStyle: ShapePath.DashLine + PathLine { relativeX: 140; relativeY: 0 } + } + + ShapePath { + startY: 105 + strokeWidth: 3 + dashPattern: [2, 2] + capStyle: ShapePath.FlatCap + strokeColor: "blue" + startX: 10 + strokeStyle: ShapePath.DashLine + PathLine { relativeX: 140; relativeY: 0 } + } + + ShapePath { + startY: 110 + strokeWidth: 3 + dashPattern: [4, 2, 2, 3, 5, 1] + capStyle: ShapePath.FlatCap + strokeColor: "blue" + startX: 10 + strokeStyle: ShapePath.DashLine + PathLine { relativeX: 140; relativeY: 0 } + } + + ShapePath { + startY: 115 + strokeWidth: 3 + dashPattern: [1, 2, 3, 4] + capStyle: ShapePath.FlatCap + strokeColor: "blue" + startX: 10 + strokeStyle: ShapePath.DashLine + PathLine { relativeX: 140; relativeY: 0 } + } + + ShapePath { + startY: 120 + strokeWidth: 3 + dashPattern: [1, 2, 3, 4] + dashOffset: 1 + capStyle: ShapePath.FlatCap + strokeColor: "blue" + startX: 10 + strokeStyle: ShapePath.DashLine + PathLine { relativeX: 140; relativeY: 0 } + } + + ShapePath { + startY: 125 + strokeWidth: 3 + dashPattern: [1, 2, 3, 4] + dashOffset: 3 + capStyle: ShapePath.FlatCap + strokeColor: "blue" + startX: 10 + strokeStyle: ShapePath.DashLine + PathLine { relativeX: 140; relativeY: 0 } + } + + ShapePath { + startY: 130 + strokeWidth: 3 + dashPattern: [1, 2, 3, 4] + dashOffset: 6 + capStyle: ShapePath.FlatCap + strokeColor: "blue" + startX: 10 + strokeStyle: ShapePath.DashLine + PathLine { relativeX: 140; relativeY: 0 } + } + + ShapePath { + startY: 135 + strokeWidth: 3 + dashPattern: [1, 2, 3, 4] + dashOffset: 10 + capStyle: ShapePath.FlatCap + strokeColor: "blue" + startX: 10 + strokeStyle: ShapePath.DashLine + PathLine { relativeX: 140; relativeY: 0 } + } + + + ShapePath { + startY: 150 + strokeWidth: 7 + dashPattern: [3, 2] + capStyle: ShapePath.RoundCap + strokeColor: "blue" + startX: 10 + strokeStyle: ShapePath.DashLine + PathLine { relativeX: 140; relativeY: 0 } + } + + ShapePath { + startY: 160 + strokeWidth: 7 + dashPattern: [3, 1.5] + capStyle: ShapePath.RoundCap + strokeColor: "blue" + startX: 10 + strokeStyle: ShapePath.DashLine + PathLine { relativeX: 140; relativeY: 0 } + } + + ShapePath { + startY: 170 + strokeWidth: 7 + dashPattern: [3, 1] + capStyle: ShapePath.RoundCap + strokeColor: "blue" + startX: 10 + strokeStyle: ShapePath.DashLine + PathLine { relativeX: 140; relativeY: 0 } + } + + ShapePath { + startY: 180 + strokeWidth: 7 + dashPattern: [3, 0.7] + capStyle: ShapePath.RoundCap + strokeColor: "blue" + startX: 10 + strokeStyle: ShapePath.DashLine + PathLine { relativeX: 140; relativeY: 0 } + } + + ShapePath { + startY: 190 + strokeWidth: 7 + dashPattern: [3, 0.2] + capStyle: ShapePath.RoundCap + strokeColor: "blue" + startX: 10 + strokeStyle: ShapePath.DashLine + PathLine { relativeX: 140; relativeY: 0 } + } + + ShapePath { + startY: 200 + strokeWidth: 7 + dashPattern: [3, 0] + capStyle: ShapePath.RoundCap + strokeColor: "blue" + startX: 10 + strokeStyle: ShapePath.DashLine + PathLine { relativeX: 140; relativeY: 0 } + } + + ShapePath { + // QTBUG-123805 + startY: 210 + strokeWidth: 5.8575662686300545; + dashPattern: [2, 2] + dashOffset: 4 + capStyle: ShapePath.FlatCap + strokeColor: "blue" + startX: 10 + strokeStyle: ShapePath.DashLine + PathLine { relativeX: 140; relativeY: 0 } + } + + ShapePath { + startY: 220 + strokeWidth: 3 + dashPattern: [3, 3, 2] + capStyle: ShapePath.FlatCap + strokeColor: "blue" + startX: 10 + strokeStyle: ShapePath.DashLine + PathLine { relativeX: 140; relativeY: 0 } + } + + ShapePath { + startY: 225 + strokeWidth: 3 + dashPattern: [0, 3, 2] + capStyle: ShapePath.FlatCap + strokeColor: "blue" + startX: 10 + strokeStyle: ShapePath.DashLine + PathLine { relativeX: 140; relativeY: 0 } + } + + ShapePath { + startY: 230 + strokeWidth: 3 + dashPattern: [-3, 3, 2] + capStyle: ShapePath.FlatCap + strokeColor: "blue" + startX: 10 + strokeStyle: ShapePath.DashLine + PathLine { relativeX: 140; relativeY: 0 } + } + + ShapePath { + startY: 235 + strokeWidth: 3 + dashPattern: [-3, 3, 2] + dashOffset: 1 + capStyle: ShapePath.FlatCap + strokeColor: "blue" + startX: 10 + strokeStyle: ShapePath.DashLine + PathLine { relativeX: 140; relativeY: 0 } + } + + ShapePath { + startY: 240 + strokeWidth: 3 + dashPattern: [-3, 3, 2] + dashOffset: -1 + capStyle: ShapePath.FlatCap + strokeColor: "blue" + startX: 10 + strokeStyle: ShapePath.DashLine + PathLine { relativeX: 140; relativeY: 0 } + } + + ShapePath { + startY: 245 + strokeWidth: 3 + dashPattern: [-5, 2] + capStyle: ShapePath.FlatCap + strokeColor: "blue" + startX: 10 + strokeStyle: ShapePath.DashLine + PathLine { relativeX: 140; relativeY: 0 } + } + + ShapePath { + startY: 250 + strokeWidth: 3 + dashPattern: [5, -2] + capStyle: ShapePath.FlatCap + strokeColor: "blue" + startX: 10 + strokeStyle: ShapePath.DashLine + PathLine { relativeX: 140; relativeY: 0 } + } + + ShapePath { + startY: 255 + strokeWidth: 3 + dashPattern: [-5, -2] + capStyle: ShapePath.FlatCap + strokeColor: "blue" + startX: 10 + strokeStyle: ShapePath.DashLine + PathLine { relativeX: 140; relativeY: 0 } + } + + ShapePath { + startY: 260 + strokeWidth: 3 + dashPattern: [-5, -2, -4] + capStyle: ShapePath.FlatCap + strokeColor: "blue" + startX: 10 + strokeStyle: ShapePath.DashLine + PathLine { relativeX: 140; relativeY: 0 } + } + + ShapePath { + startY: 265 + strokeWidth: 3 + dashPattern: [-5, -2, 4] + capStyle: ShapePath.FlatCap + strokeColor: "blue" + startX: 10 + strokeStyle: ShapePath.DashLine + PathLine { relativeX: 140; relativeY: 0 } + } + } + } + } + } +} diff --git a/tests/baseline/scenegraph/data/shape/shape_fillItem.qml b/tests/baseline/scenegraph/data/shape/shape_fillItem.qml new file mode 100644 index 0000000000..0862e364b5 --- /dev/null +++ b/tests/baseline/scenegraph/data/shape/shape_fillItem.qml @@ -0,0 +1,177 @@ +import QtQuick +import QtQuick.Shapes + +Item { + width: 640 + height: 840 + + ListModel { + id: renderers + ListElement { renderer: Shape.GeometryRenderer; rotationAmount: 0 } + ListElement { renderer: Shape.GeometryRenderer; rotationAmount: 30 } + ListElement { renderer: Shape.CurveRenderer; rotationAmount: 0 } + ListElement { renderer: Shape.CurveRenderer; rotationAmount: 30 } + } + + Image { + id: image + visible: false + source: "../shared/col320x480.jpg" + } + + Image { + id: tiledImage + visible: false + source: "../shared/col320x480.jpg" + layer.enabled: true + layer.smooth: true + layer.wrapMode: ShaderEffectSource.Repeat + } + + Image { + id: asynchronousImage + visible: false + source: "../shared/col320x480.jpg" + layer.enabled: true + layer.smooth: true + layer.wrapMode: ShaderEffectSource.Repeat + asynchronous: true + } + + Rectangle { + id: item + visible: false + layer.enabled: true + layer.smooth: true + layer.wrapMode: ShaderEffectSource.Repeat + color: "cyan" + width: 20 + height: 20 + Text { + anchors.centerIn: parent + text: "😊" + } + } + + Rectangle { + id: sourceItem + color: "cyan" + width: 20 + height: 20 + Text { + anchors.centerIn: parent + text: "😁" + } + } + + ShaderEffectSource { + id: shaderEffectSource + sourceItem: sourceItem + width: 20 + height: 20 + wrapMode: ShaderEffectSource.Repeat + visible: false + hideSource: true + smooth: true + } + + Row { + anchors.fill: parent + Repeater { + model: renderers + Column { + Shape { + id: shape + preferredRendererType: renderer + width: 160 + height: 700 + property real rotate: rotationAmount + + ShapePath { + strokeColor: "transparent" + fillItem: image + fillTransform: PlanarTransform.fromRotate(shape.rotate) + + PathRectangle { + x: 10; y: 10 + width: 140 + height: 100 + } + + // startX: 10; startY: 10 + // PathLine { relativeX: 140; relativeY: 0 } + // PathLine { relativeX: 0; relativeY: 100 } + // PathLine { relativeX: -140; relativeY: 0 } + // PathLine { relativeX: 0; relativeY: -100 } + } + + ShapePath { + strokeColor: "transparent" + fillItem: tiledImage + + PathRectangle { + x: 10; y: 10 + 1 * 140 + width: 140 + height: 100 + } + fillTransform: PlanarTransform.fromRotate(shape.rotate) + } + + ShapePath { + strokeColor: "transparent" + fillItem: item + fillTransform: PlanarTransform.fromRotate(shape.rotate) + + PathRectangle { + x: 10; y: 10 + 2 * 140 + width: 140 + height: 100 + } + } + + ShapePath { + strokeColor: "transparent" + fillItem: asynchronousImage + fillTransform: PlanarTransform.fromRotate(shape.rotate) + + PathRectangle { + x: 10; y: 10 + 3 * 140 + width: 140 + height: 100 + } + } + + ShapePath { + strokeColor: "transparent" + fillItem: shaderEffectSource + fillTransform: PlanarTransform.fromRotate(shape.rotate) + + PathRectangle { + x: 10; y: 10 + 4 * 140 + width: 140 + height: 100 + } + } + } + + Shape { + preferredRendererType: renderer + width: 160 + height: 200 + x: 10 + + ShapePath { + strokeColor: "transparent" + fillItem: image + fillTransform: PlanarTransform.fromRotate(shape.rotate) + + PathRectangle { + width: 140 + height: 100 + } + } + } + } + } + } +} diff --git a/tests/baseline/scenegraph/data/shape/shape_gradient_xf.qml b/tests/baseline/scenegraph/data/shape/shape_gradient_xf.qml new file mode 100644 index 0000000000..a0a33d9f2c --- /dev/null +++ b/tests/baseline/scenegraph/data/shape/shape_gradient_xf.qml @@ -0,0 +1,81 @@ +import QtQuick +import QtQuick.Shapes + +Item { + width: 320 + height: 480 + + ListModel { + id: renderers + ListElement { renderer: Shape.GeometryRenderer } + ListElement { renderer: Shape.CurveRenderer } + } + + Row { + Repeater { + model: renderers + Column { + Shape { + preferredRendererType: renderer + width: 160 + height: 150 + + ShapePath { + strokeColor: "transparent" + fillGradient: LinearGradient { + y1: 50; y2: 80 + GradientStop { position: 0; color: "black" } + GradientStop { position: 1; color: "cyan" } + } + fillTransform: PlanarTransform.fromAffineMatrix(0.8, 0.2, 0.3, 1.5, 20, -50 + startY) + + startX: 10; startY: 10 + PathLine { relativeX: 140; relativeY: 0 } + PathLine { relativeX: 0; relativeY: 100 } + PathLine { relativeX: -140; relativeY: 0 } + PathLine { relativeX: 0; relativeY: -100 } + } + + ShapePath { + strokeColor: "transparent" + fillGradient: RadialGradient { + centerX: 80 + centerY: 75 + centerRadius: centerY + focalX: centerX + focalY: centerY + GradientStop { position: 0; color: "black" } + GradientStop { position: .5; color: "cyan" } + GradientStop { position: 1; color: "black" } + } + fillTransform: PlanarTransform.fromAffineMatrix(0.8, 0.2, 0.3, 1.5, 20, -50 + startY) + + startX: 10; startY: 10 + 1 * 140 + PathLine { relativeX: 140; relativeY: 0 } + PathLine { relativeX: 0; relativeY: 100 } + PathLine { relativeX: -140; relativeY: 0 } + PathLine { relativeX: 0; relativeY: -100 } + } + + ShapePath { + strokeColor: "transparent" + fillGradient: ConicalGradient { + centerX: 80 + centerY: 75 + GradientStop { position: 0; color: "black" } + GradientStop { position: .5; color: "cyan" } + GradientStop { position: 1; color: "black" } + } + fillTransform: PlanarTransform.fromAffineMatrix(0.8, 0.2, 0.3, 1.5, 20, -50 + startY) + + startX: 10; startY: 10 + 2 * 140 + PathLine { relativeX: 140; relativeY: 0 } + PathLine { relativeX: 0; relativeY: 100 } + PathLine { relativeX: -140; relativeY: 0 } + PathLine { relativeX: 0; relativeY: -100 } + } + } + } + } + } +} diff --git a/tests/baseline/scenegraph/data/shape/shape_implicit_size.qml b/tests/baseline/scenegraph/data/shape/shape_implicit_size.qml new file mode 100644 index 0000000000..49481a5417 --- /dev/null +++ b/tests/baseline/scenegraph/data/shape/shape_implicit_size.qml @@ -0,0 +1,91 @@ +import QtQuick +import QtQuick.Shapes + +Item { + width: 320 + height: 480 + + ListModel { + id: renderers + ListElement { renderer: Shape.GeometryRenderer } + ListElement { renderer: Shape.CurveRenderer } + } + + + component ExampleShape : Shape { + preferredRendererType: renderer + ShapePath { + strokeWidth: 2 + strokeColor: "black" + fillColor: "#77ff99" + + startX: 30; startY: 30 + PathQuad { + x: 100; y: 100 + controlX: 30; controlY: 100 + } + } + ShapePath { + fillColor: "gray" + strokeColor: "transparent" + PathText { + x: 30 + y: 50 + font.family: "Arial" + font.pixelSize: 64 + text: "Test" + } + } + } + + component ShowRect: Rectangle { + color: "transparent" + border.color: "blue" + border.width: 2 + radius: 10 + } + + Row { + x: 10 + y: 10 + Repeater { + model: renderers + Column { + Item { + width: 150 + height: 150 + ExampleShape { + id: testSize + } + ShowRect { + anchors.fill: testSize + } + } + Item { + width: 150 + height: 150 + ExampleShape { + id: testBoundingRect + } + ShowRect { + x: testBoundingRect.boundingRect.x + y: testBoundingRect.boundingRect.y + width: testBoundingRect.boundingRect.width + height: testBoundingRect.boundingRect.height + } + } + Item { + width: 150 + height: 150 + ExampleShape { + id: testImplicitSize + } + ShowRect { + width: testImplicitSize.implicitWidth + height: testImplicitSize.implicitHeight + } + } + } + } + } +} diff --git a/tests/baseline/scenegraph/data/shape/shape_intersecting1.qml b/tests/baseline/scenegraph/data/shape/shape_intersecting1.qml new file mode 100644 index 0000000000..a507b40c6d --- /dev/null +++ b/tests/baseline/scenegraph/data/shape/shape_intersecting1.qml @@ -0,0 +1,68 @@ +// Copyright (C) 2023 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only + +import QtQuick +import QtQuick.Shapes + +Item { + width: 600 + height: 600 + + ListModel { + id: fillRules + ListElement { fillrule: ShapePath.WindingFill } + ListElement { fillrule: ShapePath.OddEvenFill } + } + + ListModel { + id: renderers + ListElement { renderer: Shape.GeometryRenderer } + ListElement { renderer: Shape.CurveRenderer } + } + + ListModel { + id: svgstrings + ListElement { scaleToFit: 0.11; offsetX: 20; offsetY: 20; pathString: "M 885.276 1047.5 Q 1310 -265 722.654 1071.85 Q 1100 1100 636.857 929.582 Q 100 1100 322.456 883.006 L 1003.49 134.715 Q 944.382 591.106 0 0 L 885.276 1047.5"} + ListElement { scaleToFit: 0.035; offsetX: -60; offsetY: 0; pathString: "M 5000 3475 Q 5600 825 2290 245 Q 3635 -30 5360 3885 Q 730 2990 4685 390 L 2445 1435 L 5000 3475" } + ListElement { scaleToFit: 0.11; offsetX: 10; offsetY: 10; pathString: "M 600 200 Q 1000 600 600 1000 Q 200 1200 200 600 Q 200 200 600 200 M 1000 200 Q 1400 600 1000 1000 Q 600 1200 600 600 Q 200 -200 1000 200" } + ListElement { scaleToFit: 0.11; offsetX: -10; offsetY: 10; pathString: "M 865 270 Q 1000 600 955 820 Q 675 690 775 525 Q 200 200 865 270 M 1000 200 Q 1400 600 1000 1000 Q 600 1200 590 635 Q 200 -200 1000 200" } + } + + Column { + Repeater { + model: renderers + Column { + Repeater { + model: fillRules + Row { + Repeater { + model: svgstrings + Rectangle { + width: 150 + height: 150 + border.color: "black" + + Shape { + preferredRendererType: renderer + ShapePath { + fillColor: renderer == Shape.CurveRenderer ? "#99483d8b" : "#99dc143c" + fillRule: fillrule + strokeWidth: 0 + PathSvg { path: pathString } + } + + transform: Matrix4x4 { + matrix: Qt.matrix4x4(scaleToFit, 0, 0, offsetX, + 0, scaleToFit, 0, offsetY, + 0, 0, 1, 0, + 0, 0, 0, 1) + } + } + } + } + } + } + } + } + } +} diff --git a/tests/baseline/scenegraph/data/shape/shape_intersecting2.qml b/tests/baseline/scenegraph/data/shape/shape_intersecting2.qml new file mode 100644 index 0000000000..d2e0fd1bd0 --- /dev/null +++ b/tests/baseline/scenegraph/data/shape/shape_intersecting2.qml @@ -0,0 +1,68 @@ +// Copyright (C) 2023 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only + +import QtQuick +import QtQuick.Shapes + +Item { + width: 600 + height: 600 + + ListModel { + id: fillRules + ListElement { fillrule: ShapePath.WindingFill } + ListElement { fillrule: ShapePath.OddEvenFill } + } + + ListModel { + id: renderers + ListElement { renderer: Shape.GeometryRenderer } + ListElement { renderer: Shape.CurveRenderer } + } + + ListModel { + id: svgstrings + ListElement { scaleToFit: 0.11; offsetX: -10; offsetY: 10; pathString: "M 568.243 506.927 Q 1000 600 955 820 Q 675 690 1007.14 396.964 Q 616.417 79.1432 568.243 506.927 M 1000 200 Q 1400 600 1000 1000 Q 600 1200 590 635 Q 200 -200 1000 200" } + ListElement { scaleToFit: 0.11; offsetX: -10; offsetY: 10; pathString: "M 562.26 285.556 Q 728.371 717.267 955 820 Q 1037.57 642.136 1007.14 396.964 Q 616.417 79.1432 562.26 285.556 M 1000 200 Q 1400 600 1000 1000 Q 600 1200 590 635 Q 200 -200 1000 200" } + ListElement { scaleToFit: 0.09; offsetX: -10; offsetY: 10; pathString: "M 550.789, 661.103 Q 1435.03, -8.14249 1668.28, 799.321 Q 1100, 1100 593.639, 527.481 Q 593.639 527.481 100 1100 100 600 Q 100 600 1208.1 876.376 2316.21, 1152.75 Q 2316.21 1152.75 1433.5 906.927 550.789 661.103" } + ListElement { scaleToFit: 0.04; offsetX: 35; offsetY: 10; pathString: "M 846.361 1397.06 Q 2485 -660 2485 1015 Q 1598.13 4529.81 975 290 Q -69.0821 3853.43 -568.237 1473.61 L 2515.73 2262.31 L 846.361 1397.06" } + } + + Column { + Repeater { + model: renderers + Column { + Repeater { + model: fillRules + Row { + Repeater { + model: svgstrings + Rectangle { + width: 150 + height: 150 + border.color: "black" + + Shape { + preferredRendererType: renderer + ShapePath { + fillColor: renderer == Shape.CurveRenderer ? "#99483d8b" : "#99dc143c" + fillRule: fillrule + strokeWidth: 0 + PathSvg { path: pathString } + } + + transform: Matrix4x4 { + matrix: Qt.matrix4x4(scaleToFit, 0, 0, offsetX, + 0, scaleToFit, 0, offsetY, + 0, 0, 1, 0, + 0, 0, 0, 1) + } + } + } + } + } + } + } + } + } +} diff --git a/tests/baseline/scenegraph/data/shape/shape_intersecting3.qml b/tests/baseline/scenegraph/data/shape/shape_intersecting3.qml new file mode 100644 index 0000000000..f56ebc2a3b --- /dev/null +++ b/tests/baseline/scenegraph/data/shape/shape_intersecting3.qml @@ -0,0 +1,68 @@ +// Copyright (C) 2023 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only + +import QtQuick +import QtQuick.Shapes + +Item { + width: 600 + height: 600 + + ListModel { + id: fillRules + ListElement { fillrule: ShapePath.WindingFill } + ListElement { fillrule: ShapePath.OddEvenFill } + } + + ListModel { + id: renderers + ListElement { renderer: Shape.GeometryRenderer } + ListElement { renderer: Shape.CurveRenderer } + } + + ListModel { + id: svgstrings + ListElement { scaleToFit: 0.11; offsetX: 20; offsetY: 20; pathString: "M 200 200 Q 600 1000 1000 200 Q -100 200 200 1000 Q -100 1000 -100 500 Q -300 200 200 200 M 300 200 L 800 700 L 300 700 L 800 200 L 300 200"} + ListElement { scaleToFit: 0.11; offsetX: 20; offsetY: 20; pathString: "M 200 200 Q 600 1000 1000 200 Q -100 200 200 1000 Q -100 1000 -100 500 Q -300 200 200 200 M 300 200 L 300 700 L 800 200 L 800 700 L 300 200"} + ListElement { scaleToFit: 1; offsetX: 0; offsetY: 0; pathString: "M 128.84 103.6 L 112.71 68.78 L 64.32 19.15 L 144.33 94.34 L 47.33 98.82 Q 37.0 60.87 39.01 12.06 L 51.92 72.5 L 19.87 130.09 L 139.11 47.81 Q 110.47 70.31 113.71 87.09 "} + ListElement { scaleToFit: 1; offsetX: 0; offsetY: 0; pathString: "M 85.23 92.08 Q 126.6 2.98 23.72 51.94 Z M 103.97 123.27 L 145.32 76.51 Z M 134.57 28.24 L 41.44 8.54 Z M 43.48 123.1 Q 58.58 39.75 92.72 144.17 Z M 23.86 116.3 Q 5.82 83.87 84.11 130.88"} + } + + Column { + Repeater { + model: renderers + Column { + Repeater { + model: fillRules + Row { + Repeater { + model: svgstrings + Rectangle { + width: 150 + height: 150 + border.color: "black" + + Shape { + preferredRendererType: renderer + ShapePath { + fillColor: renderer == Shape.CurveRenderer ? "#99483d8b" : "#99dc143c" + fillRule: fillrule + strokeWidth: 0 + PathSvg { path: pathString } + } + + transform: Matrix4x4 { + matrix: Qt.matrix4x4(scaleToFit, 0, 0, offsetX, + 0, scaleToFit, 0, offsetY, + 0, 0, 1, 0, + 0, 0, 0, 1) + } + } + } + } + } + } + } + } + } +} diff --git a/tests/baseline/scenegraph/data/shape/shape_intersecting4.qml b/tests/baseline/scenegraph/data/shape/shape_intersecting4.qml new file mode 100644 index 0000000000..6815906d34 --- /dev/null +++ b/tests/baseline/scenegraph/data/shape/shape_intersecting4.qml @@ -0,0 +1,72 @@ +// Copyright (C) 2023 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only + +import QtQuick +import QtQuick.Shapes + +Item { + width: 600 + height: 600 + + ListModel { + id: fillRules + ListElement { fillrule: ShapePath.WindingFill } + ListElement { fillrule: ShapePath.OddEvenFill } + } + + ListModel { + id: renderers + ListElement { renderer: Shape.GeometryRenderer } + ListElement { renderer: Shape.CurveRenderer } + } + + ListModel { + id: svgstrings + ListElement { scaleToFit: 1; offsetX: 0; offsetY: 0; pathString: "M 64.9 142.96 Q 4.68 9.31 7.25 121.42 Z M 5.3 86.37 Q 31.57 11.81 34.04 5.0 Q 25.26 47.39 31.31 87.97 Z M 4.2 17.35 L 33.27 124.0 Q 111.36 33.37 8.23 118.77 L 65.78 27.48 Q 139.84 87.06 96.03 23.08"} + ListElement { scaleToFit: 1; offsetX: 0; offsetY: 0; pathString: "M 88.78 105.24 L 69.72 114.27 L 26.94 71.0 Q 62.05 122.52 83.1 22.44 Q 105.46 40.25 108.12 54.23 L 103.51 40.41 Q 70.16 41.09 29.88 96.16 Z M 60.49 96.92 L 14.58 112.34 Q 1.76 12.05 106.52 128.97"} + // These don't work because there are subpaths with just two lines in it: + // ListElement { scaleToFit: 1; offsetX: 0; offsetY: 0; pathString: "M 70.21 146.61 L 54.01 6.38 Z M 52.51 5.75 L 70.75 44.78 L 81.98 128.43 Z M 2.71 72.51 L 96.86 4.48 L 136.96 83.88 Z M 25.32 52.79 Q 3.59 111.11 125.15 137.23"} + // ListElement { scaleToFit: 1; offsetX: 0; offsetY: 0; pathString: "M 131.61 147.43 L 4.5 6.5 L 110.44 40.71 Q 128.69 39.15 136.85 6.84 Q 8.9 139.71 76.35 103.86 L 77.47 43.63 L 127.06 97.65 L 14.97 66.38 Z M 47.53 0.08 L 42.02 33.25"} + // Removing those lines fixes the problem. We might want to do it in the intersectionSolver at some point. + ListElement { scaleToFit: 1; offsetX: 0; offsetY: 0; pathString: "M 52.51 5.75 L 70.75 44.78 L 81.98 128.43 Z M 2.71 72.51 L 96.86 4.48 L 136.96 83.88 Z M 25.32 52.79 Q 3.59 111.11 125.15 137.23"} + ListElement { scaleToFit: 1; offsetX: 0; offsetY: 0; pathString: "M 131.61 147.43 L 4.5 6.5 L 110.44 40.71 Q 128.69 39.15 136.85 6.84 Q 8.9 139.71 76.35 103.86 L 77.47 43.63 L 127.06 97.65 L 14.97 66.38 Z"} + } + + Column { + Repeater { + model: renderers + Column { + Repeater { + model: fillRules + Row { + Repeater { + model: svgstrings + Rectangle { + width: 150 + height: 150 + border.color: "black" + + Shape { + preferredRendererType: renderer + ShapePath { + fillColor: renderer == Shape.CurveRenderer ? "#99483d8b" : "#99dc143c" + fillRule: fillrule + strokeWidth: 0 + PathSvg { path: pathString } + } + + transform: Matrix4x4 { + matrix: Qt.matrix4x4(scaleToFit, 0, 0, offsetX, + 0, scaleToFit, 0, offsetY, + 0, 0, 1, 0, + 0, 0, 0, 1) + } + } + } + } + } + } + } + } + } +} diff --git a/tests/baseline/scenegraph/data/shape/shape_intersecting5.qml b/tests/baseline/scenegraph/data/shape/shape_intersecting5.qml new file mode 100644 index 0000000000..447b192182 --- /dev/null +++ b/tests/baseline/scenegraph/data/shape/shape_intersecting5.qml @@ -0,0 +1,67 @@ +// Copyright (C) 2023 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only + +import QtQuick +import QtQuick.Shapes + +Item { + width: 600 + height: 600 + + ListModel { + id: fillRules + ListElement { fillrule: ShapePath.WindingFill } + ListElement { fillrule: ShapePath.OddEvenFill } + } + + ListModel { + id: renderers + ListElement { renderer: Shape.GeometryRenderer } + ListElement { renderer: Shape.CurveRenderer } + } + + ListModel { + id: svgstrings + ListElement { scaleToFit: 1; offsetX: 20; offsetY: 20; pathString: "M 10,30 A 20,20 0,0,1 50,30 A 20,20 0,0,1 90,30 Q 90,60 50,90 Q 10,60 10,30 M 5 40 L 100 40 L 100 60 L 5 60 Z" } + ListElement { scaleToFit: 5; offsetX: 10; offsetY: 20; pathString: "M 7.10938 0 Q 7.73438 0 8.28125 0.140625 Q 8.82813 0.28125 9.14063 0.546875 L 8.64063 2.10938 Q 8.35938 1.92188 8.02344 1.83594 Q 7.6875 1.75 7.26563 1.75 Q 6.23438 1.75 5.66406 2.24219 Q 5.09375 2.73438 5.09375 3.8125 L 5.09375 5.64063 L 5.09375 6.26563 L 5.09375 17.6406 L 3.17188 17.6406 L 3.17188 3.625 Q 3.17188 2.82813 3.40625 2.15625 Q 3.64063 1.48438 4.13281 1.00781 Q 4.625 0.53125 5.375 0.265625 Q 6.125 1.77636e-15 7.10938 0 M 9.09375 5.64063 L 9.09375 7.29688 L 0.765625 7.29688 L 0.765625 5.64063 L 9.09375 5.64063 M 16.2813 5.40625 Q 17.9844 5.40625 19.2891 6.14844 Q 20.5938 6.89063 21.3438 8.29688 Q 22.0938 9.70313 22.0938 11.6406 Q 22.0938 13.5781 21.3438 14.9844 Q 20.5938 16.3906 19.2891 17.1328 Q 17.9844 17.875 16.2813 17.875 Q 14.5938 17.875 13.2734 17.1328 Q 11.9531 16.3906 11.2109 14.9844 Q 10.4688 13.5781 10.4688 11.6406 Q 10.4688 9.70313 11.2109 8.29688 Q 11.9531 6.89063 13.2734 6.14844 Q 14.5938 5.40625 16.2813 5.40625 M 16.2813 7.0625 Q 15.0469 7.0625 14.1875 7.60938 Q 13.3281 8.15625 12.8594 9.17969 Q 12.3906 10.2031 12.3906 11.6406 Q 12.3906 13.0625 12.8594 14.0938 Q 13.3281 15.125 14.1875 15.6719 Q 15.0469 16.2188 16.2813 16.2188 Q 17.5 16.2188 18.3672 15.6719 Q 19.2344 15.125 19.7031 14.0938 Q 20.1719 13.0625 20.1719 11.6406 Q 20.1719 10.2031 19.7031 9.17969 Q 19.2344 8.15625 18.3672 7.60938 Q 17.5 7.0625 16.2813 7.0625" } + ListElement { scaleToFit: 5; offsetX: -120; offsetY: 20; pathString: "M 30.6719 5.40625 Q 32.375 5.40625 33.6797 6.14844 Q 34.9844 6.89063 35.7344 8.29688 Q 36.4844 9.70313 36.4844 11.6406 Q 36.4844 13.5781 35.7344 14.9844 Q 34.9844 16.3906 33.6797 17.1328 Q 32.375 17.875 30.6719 17.875 Q 28.9844 17.875 27.6641 17.1328 Q 26.3438 16.3906 25.6016 14.9844 Q 24.8594 13.5781 24.8594 11.6406 Q 24.8594 9.70313 25.6016 8.29688 Q 26.3438 6.89063 27.6641 6.14844 Q 28.9844 5.40625 30.6719 5.40625 M 30.6719 7.0625 Q 29.4375 7.0625 28.5781 7.60938 Q 27.7188 8.15625 27.25 9.17969 Q 26.7813 10.2031 26.7813 11.6406 Q 26.7813 13.0625 27.25 14.0938 Q 27.7188 15.125 28.5781 15.6719 Q 29.4375 16.2188 30.6719 16.2188 Q 31.8906 16.2188 32.7578 15.6719 Q 33.625 15.125 34.0938 14.0938 Q 34.5625 13.0625 34.5625 11.6406 Q 34.5625 10.2031 34.0938 9.17969 Q 33.625 8.15625 32.7578 7.60938 Q 31.8906 7.0625 30.6719 7.0625 M 45.9688 17.875 Q 44.9688 17.875 44.1016 17.5156 Q 43.2344 17.1563 42.6094 16.5078 Q 41.9844 15.8594 41.6719 15.0469 L 41.9375 14.7188 L 41.7656 17.6406 L 40.0938 17.6406 L 40.0938 0.125 L 42.0156 0.125 L 42.0156 8.35938 L 41.7656 7.98438 Q 42.25 6.85938 43.3906 6.13281 Q 44.5313 5.40625 46 5.40625 Q 47.4844 5.40625 48.7344 6.14844 Q 49.9844 6.89063 50.7266 8.28125 Q 51.4688 9.67188 51.4688 11.6406 Q 51.4688 13.5781 50.7109 14.9844 Q 49.9531 16.3906 48.7031 17.1328 Q 47.4531 17.875 45.9688 17.875 M 45.7813 16.2031 Q 47.5625 16.2031 48.5547 14.9531 Q 49.5469 13.7031 49.5469 11.6406 Q 49.5469 9.57813 48.5625 8.32813 Q 47.5781 7.07813 45.7969 7.07813 Q 44.6719 7.07813 43.8203 7.65625 Q 42.9688 8.23438 42.4922 9.26563 Q 42.0156 10.2969 42.0156 11.6875 Q 42.0156 13.0625 42.4844 14.0781 Q 42.9531 15.0938 43.8047 15.6484 Q 44.6563 16.2031 45.7813 16.2031" } + ListElement { scaleToFit: 5; offsetX: -260; offsetY: 20; pathString: "M 62.1406 9.89063 Q 62.1406 8.54688 61.4219 7.8125 Q 60.7031 7.07813 59.3906 7.07813 Q 58.1406 7.07813 57.2734 7.61719 Q 56.4063 8.15625 56 9.35938 L 54.4375 8.40625 Q 54.9219 7.0625 56.2188 6.23438 Q 57.5156 5.40625 59.4375 5.40625 Q 60.7344 5.40625 61.7891 5.84375 Q 62.8438 6.28125 63.4531 7.1875 Q 64.0625 8.09375 64.0625 9.5 L 64.0625 15.3125 Q 64.0625 16.1719 64.9844 16.1719 Q 65.4375 16.1719 65.875 16.0625 L 65.7656 17.5625 Q 65.2969 17.8125 64.5156 17.8125 Q 63.8281 17.8125 63.2734 17.5469 Q 62.7188 17.2813 62.4063 16.7422 Q 62.0938 16.2031 62.0938 15.3906 L 62.0938 15.1406 L 62.5781 15.2188 Q 62.2969 16.1563 61.6016 16.7422 Q 60.9063 17.3281 60.0391 17.6016 Q 59.1719 17.875 58.3281 17.875 Q 57.2813 17.875 56.3672 17.5156 Q 55.4531 17.1563 54.9141 16.4297 Q 54.375 15.7031 54.375 14.6094 Q 54.375 13.2656 55.2734 12.3906 Q 56.1719 11.5156 57.7813 11.2031 L 62.5313 10.2656 L 62.5313 11.8594 L 58.6719 12.6406 Q 57.4844 12.8906 56.9141 13.3203 Q 56.3438 13.75 56.3438 14.5156 Q 56.3438 15.2656 56.9297 15.7344 Q 57.5156 16.2031 58.5938 16.2031 Q 59.2969 16.2031 59.9297 16.0234 Q 60.5625 15.8438 61.0703 15.4688 Q 61.5781 15.0938 61.8594 14.5313 Q 62.1406 13.9688 62.1406 13.2031 L 62.1406 9.89063 M 68.7188 17.6406 L 68.7188 5.64063 L 70.2813 5.64063 L 70.5469 7.60938 Q 71.0469 6.5 72.0156 5.95313 Q 72.9844 5.40625 74.375 5.40625 Q 74.6875 5.40625 75.0625 5.45313 Q 75.4375 5.5 75.7031 5.64063 L 75.3594 7.39063 Q 75.0938 7.29688 74.7891 7.25 Q 74.4844 7.20313 73.9063 7.20313 Q 73.1563 7.20313 72.3984 7.63281 Q 71.6406 8.0625 71.1406 8.9375 Q 70.6406 9.8125 70.6406 11.1563 L 70.6406 17.6406 L 68.7188 17.6406" } + } + Column { + Repeater { + model: renderers + Column { + Repeater { + model: fillRules + Row { + Repeater { + model: svgstrings + Rectangle { + width: 150 + height: 150 + border.color: "black" + + Shape { + preferredRendererType: renderer + ShapePath { + fillColor: renderer == Shape.CurveRenderer ? "#99483d8b" : "#99dc143c" + fillRule: fillrule + strokeWidth: 0 + PathSvg { path: pathString } + } + + transform: Matrix4x4 { + matrix: Qt.matrix4x4(scaleToFit, 0, 0, offsetX, + 0, scaleToFit, 0, offsetY, + 0, 0, 1, 0, + 0, 0, 0, 1) + } + } + } + } + } + } + } + } + } +} diff --git a/tests/baseline/scenegraph/data/shape/shape_intersecting6.qml b/tests/baseline/scenegraph/data/shape/shape_intersecting6.qml new file mode 100644 index 0000000000..e1b2b80be8 --- /dev/null +++ b/tests/baseline/scenegraph/data/shape/shape_intersecting6.qml @@ -0,0 +1,67 @@ +// Copyright (C) 2023 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only + +import QtQuick +import QtQuick.Shapes + +Item { + width: 600 + height: 600 + + ListModel { + id: fillRules + ListElement { fillrule: ShapePath.WindingFill } + ListElement { fillrule: ShapePath.OddEvenFill } + } + + ListModel { + id: renderers + ListElement { renderer: Shape.GeometryRenderer } + ListElement { renderer: Shape.CurveRenderer } + } + + ListModel { + id: svgstrings + ListElement { scaleToFit: 1; offsetX: 20; offsetY: 20; pathString: "M 0 0 L 100 0 L 100 50 L 0 50 Z M 0 50 L 100 50 L 100 100 L 0 100 Z " } + ListElement { scaleToFit: 1; offsetX: 20; offsetY: 20; pathString: "M 0 0 L 0 50 L 100 50 L 100 0 Z M 0 50 L 0 100 L 100 100 L 100 50 Z " } + ListElement { scaleToFit: 1; offsetX: 20; offsetY: 20; pathString: "M 0 0 L 0 50 L 100 50 L 100 0 Z M 0 50 L 100 50 L 100 100 L 0 100 Z " } + ListElement { scaleToFit: 1; offsetX: 20; offsetY: 40; pathString: "M 0 0 L 100 0 L 100 50 L 0 50 Z M 20 0 Q 20 -30 50 -30 Q 80 -30 80 0 L 80 70 Q 50 100 20 70 Z" } + } + Column { + Repeater { + model: renderers + Column { + Repeater { + model: fillRules + Row { + Repeater { + model: svgstrings + Rectangle { + width: 150 + height: 150 + border.color: "black" + + Shape { + preferredRendererType: renderer + ShapePath { + fillColor: renderer == Shape.CurveRenderer ? "#99483d8b" : "#99dc143c" + fillRule: fillrule + strokeWidth: 0 + PathSvg { path: pathString } + } + + transform: Matrix4x4 { + matrix: Qt.matrix4x4(scaleToFit, 0, 0, offsetX, + 0, scaleToFit, 0, offsetY, + 0, 0, 1, 0, + 0, 0, 0, 1) + } + } + } + } + } + } + } + } + } +} diff --git a/tests/baseline/scenegraph/data/shape/shape_intersecting7.qml b/tests/baseline/scenegraph/data/shape/shape_intersecting7.qml new file mode 100644 index 0000000000..18fdde2cc1 --- /dev/null +++ b/tests/baseline/scenegraph/data/shape/shape_intersecting7.qml @@ -0,0 +1,67 @@ +// Copyright (C) 2023 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only + +import QtQuick +import QtQuick.Shapes + +Item { + width: 600 + height: 600 + + ListModel { + id: fillRules + ListElement { fillrule: ShapePath.WindingFill } + ListElement { fillrule: ShapePath.OddEvenFill } + } + + ListModel { + id: renderers + ListElement { renderer: Shape.GeometryRenderer } + ListElement { renderer: Shape.CurveRenderer } + } + + ListModel { + id: svgstrings + ListElement { scaleToFit: 0.08; offsetX: 20; offsetY: 20; pathString: "M 150 100 L 1250 150 L 100 1000 L 150 100 M 600 1200 Q 700 600 800 1200 Q 700 700 600 1200 M 100 1000 Q 200 1500 700 1500 Q 1200 1500 1200 1000 Q 1100 700 800 600 L 800 800 Q 1000 600 1000 1000 Q 1000 1300 700 1300 Q 400 1300 400 500 L 100 1000 " } + ListElement { scaleToFit: 1; offsetX: 20; offsetY: 20; pathString: "M 0 0 Q 50 -10 100 0 Q 110 50 100 100 Q 50 110 0 100 Q -10 50 0 0 M 10 10 Q 50 0 90 10 Q 100 50 90 90 Q 50 100 10 90 Q 0 50 10 10 M 20 20 Q 50 10 80 20 Q 100 50 80 80 Q 50 100 20 80 Q 0 50 20 20" } + ListElement { scaleToFit: 1; offsetX: 20; offsetY: 20; pathString: "M 0 0 Q 50 -10 100 0 Q 110 50 100 100 Q 50 110 0 100 Q -10 50 0 0 M 10 10 Q 0 50 10 90 Q 50 100 90 90 Q 100 50 90 10 Q 50 0 10 10 M 20 20 Q 50 10 80 20 Q 100 50 80 80 Q 50 100 20 80 Q 0 50 20 20" } + ListElement { scaleToFit: 1; offsetX: 20; offsetY: 20; pathString: "M 0 0 Q 50 -10 100 0 Q 110 50 100 100 Q 50 110 0 100 Q -10 50 0 0 M 10 10 Q 50 0 90 10 Q 100 50 90 90 Q 50 100 10 90 Q 0 50 10 10 M 20 20 Q 10 50 20 80 Q 50 100 80 80 Q 100 50 80 20 Q 50 0 20 20" } + } + Column { + Repeater { + model: renderers + Column { + Repeater { + model: fillRules + Row { + Repeater { + model: svgstrings + Rectangle { + width: 150 + height: 150 + border.color: "black" + + Shape { + preferredRendererType: renderer + ShapePath { + fillColor: renderer == Shape.CurveRenderer ? "#99483d8b" : "#99dc143c" + fillRule: fillrule + strokeWidth: 0 + PathSvg { path: pathString } + } + + transform: Matrix4x4 { + matrix: Qt.matrix4x4(scaleToFit, 0, 0, offsetX, + 0, scaleToFit, 0, offsetY, + 0, 0, 1, 0, + 0, 0, 0, 1) + } + } + } + } + } + } + } + } + } +} diff --git a/tests/baseline/scenegraph/data/shape/shape_intersecting8.qml b/tests/baseline/scenegraph/data/shape/shape_intersecting8.qml new file mode 100644 index 0000000000..fa6e062e17 --- /dev/null +++ b/tests/baseline/scenegraph/data/shape/shape_intersecting8.qml @@ -0,0 +1,64 @@ +// Copyright (C) 2023 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only + +import QtQuick +import QtQuick.Shapes + +Item { + width: 600 + height: 600 + + ListModel { + id: fillRules + ListElement { fillrule: ShapePath.WindingFill } + ListElement { fillrule: ShapePath.OddEvenFill } + } + + ListModel { + id: renderers + ListElement { renderer: Shape.GeometryRenderer } + ListElement { renderer: Shape.CurveRenderer } + } + + ListModel { + id: svgstrings + ListElement { scaleToFit: 0.6; offsetX: 20; offsetY: 20; pathString: "M 10 100 Q 10 89.6447 17.3223 82.3223 Q 24.6447 75 35 75 Q 45.3553 75 52.6777 82.3223 Q 60 89.6447 60 100 Q 60 85.5025 67.3223 75.2513 Q 74.6447 65 85 65 Q 95.3553 65 102.678 75.2513 Q 110 85.5025 110 100 Q 110 75.1472 117.322 57.5736 Q 124.645 40 135 40 Q 145.355 40 152.678 57.5736 Q 160 75.1472 160 100 Q 171.603 83.923 185 83.923 Q 198.397 83.923 210 100 L 10 100" } + } + Column { + Repeater { + model: renderers + Column { + Repeater { + model: fillRules + Row { + Repeater { + model: svgstrings + Rectangle { + width: 150 + height: 150 + border.color: "black" + + Shape { + preferredRendererType: renderer + ShapePath { + fillColor: renderer == Shape.CurveRenderer ? "#99483d8b" : "#99dc143c" + fillRule: fillrule + strokeWidth: 0 + PathSvg { path: pathString } + } + + transform: Matrix4x4 { + matrix: Qt.matrix4x4(scaleToFit, 0, 0, offsetX, + 0, scaleToFit, 0, offsetY, + 0, 0, 1, 0, + 0, 0, 0, 1) + } + } + } + } + } + } + } + } + } +} diff --git a/tests/baseline/scenegraph/data/shape/shape_linear_gradient.qml b/tests/baseline/scenegraph/data/shape/shape_linear_gradient.qml index 1caaec7781..e4d87e398d 100644 --- a/tests/baseline/scenegraph/data/shape/shape_linear_gradient.qml +++ b/tests/baseline/scenegraph/data/shape/shape_linear_gradient.qml @@ -1,33 +1,47 @@ import QtQuick 2.9 -import QtQuick.Shapes 1.0 +import QtQuick.Shapes 6.6 Item { width: 320 height: 480 - Shape { - vendorExtensionsEnabled: false + ListModel { + id: renderers + ListElement { renderer: Shape.GeometryRenderer } + ListElement { renderer: Shape.CurveRenderer } + } - anchors.fill: parent + Column { + Repeater { + model: renderers + Item { + width: 200 + height: 150 + Shape { + anchors.fill: parent + preferredRendererType: renderer - ShapePath { - 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" } + ShapePath { + 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" } + } + 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 } + } + } } - 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 } } } } diff --git a/tests/baseline/scenegraph/data/shape/shape_lines.qml b/tests/baseline/scenegraph/data/shape/shape_lines.qml index 56045cb5ae..f1759e64bb 100644 --- a/tests/baseline/scenegraph/data/shape/shape_lines.qml +++ b/tests/baseline/scenegraph/data/shape/shape_lines.qml @@ -1,92 +1,108 @@ import QtQuick 2.9 -import QtQuick.Shapes 1.0 +import QtQuick.Shapes 6.6 Item { + id: root width: 320 height: 480 - Shape { - vendorExtensionsEnabled: false + ListModel { + id: renderers + ListElement { renderer: Shape.GeometryRenderer } + ListElement { renderer: Shape.CurveRenderer } + } - anchors.fill: parent + Column { + Repeater { + model: renderers + Item { + width: root.width + height: root.height / 2 - ShapePath { - strokeWidth: 1 - strokeColor: "red" - fillColor: "transparent" - PathLine { x: 50; y: 50 } - } - ShapePath { - strokeWidth: 2 - strokeColor: "blue" - fillColor: "transparent" - startX: 20 - PathLine { x: 70; y: 50 } - } - ShapePath { - strokeWidth: 3 - strokeColor: "green" - fillColor: "transparent" - startX: 40 - PathLine { x: 90; y: 50 } - } - ShapePath { - strokeWidth: 4 - strokeColor: "yellow" - fillColor: "transparent" - startX: 60 - PathLine { x: 110; y: 50 } - } - ShapePath { - strokeWidth: 5 - strokeColor: "black" - fillColor: "transparent" - strokeStyle: ShapePath.DashLine - startX: 80 - PathLine { x: 130; y: 50 } - } + Shape { + anchors.fill: parent + preferredRendererType: renderer - ShapePath { - strokeWidth: 20 - strokeColor: "gray" - fillColor: "transparent" - capStyle: ShapePath.RoundCap - startX: 120; startY: 20 - PathLine { x: 200; y: 100 } - } + ShapePath { + strokeWidth: 1 + strokeColor: "red" + fillColor: "transparent" + PathLine { x: 50; y: 50 } + } + ShapePath { + strokeWidth: 2 + strokeColor: "blue" + fillColor: "transparent" + startX: 20 + PathLine { x: 70; y: 50 } + } + ShapePath { + strokeWidth: 3 + strokeColor: "green" + fillColor: "transparent" + startX: 40 + PathLine { x: 90; y: 50 } + } + ShapePath { + strokeWidth: 4 + strokeColor: "yellow" + fillColor: "transparent" + startX: 60 + PathLine { x: 110; y: 50 } + } + ShapePath { + strokeWidth: 5 + strokeColor: "black" + fillColor: "transparent" + strokeStyle: ShapePath.DashLine + startX: 80 + PathLine { x: 130; y: 50 } + } - ShapePath { - strokeColor: "black" - strokeWidth: 16 - fillColor: "transparent" - capStyle: ShapePath.RoundCap - joinStyle: ShapePath.BevelJoin - startX: 20 - startY: 100 - PathLine { x: 120; y: 200 } - PathLine { x: 50; y: 200 } - } - ShapePath { - strokeColor: "black" - strokeWidth: 16 - fillColor: "transparent" - capStyle: ShapePath.RoundCap - joinStyle: ShapePath.MiterJoin - startX: 150 - startY: 100 - PathLine { x: 250; y: 200 } - PathLine { x: 180; y: 200 } - } - ShapePath { - strokeColor: "black" - strokeWidth: 16 - fillColor: "transparent" - capStyle: ShapePath.RoundCap - joinStyle: ShapePath.RoundJoin - startX: 270 - startY: 100 - PathLine { x: 310; y: 200 } - PathLine { x: 280; y: 200 } + ShapePath { + strokeWidth: 20 + strokeColor: "gray" + fillColor: "transparent" + capStyle: ShapePath.RoundCap + startX: 120; startY: 20 + PathLine { x: 200; y: 100 } + } + + ShapePath { + strokeColor: "black" + strokeWidth: 16 + fillColor: "transparent" + capStyle: ShapePath.RoundCap + joinStyle: ShapePath.BevelJoin + startX: 20 + startY: 100 + PathLine { x: 120; y: 200 } + PathLine { x: 50; y: 200 } + } + ShapePath { + strokeColor: "black" + strokeWidth: 16 + fillColor: "transparent" + capStyle: ShapePath.RoundCap + joinStyle: ShapePath.MiterJoin + startX: 150 + startY: 100 + PathLine { x: 250; y: 200 } + PathLine { x: 180; y: 200 } + } + ShapePath { + strokeColor: "black" + strokeWidth: 16 + fillColor: "transparent" + capStyle: ShapePath.RoundCap + joinStyle: ShapePath.RoundJoin + startX: 270 + startY: 100 + PathLine { x: 310; y: 200 } + PathLine { x: 280; y: 200 } + } + } + } } } } diff --git a/tests/baseline/scenegraph/data/shape/shape_multiline.qml b/tests/baseline/scenegraph/data/shape/shape_multiline.qml index d1fcf164cb..7b68d3c7a0 100644 --- a/tests/baseline/scenegraph/data/shape/shape_multiline.qml +++ b/tests/baseline/scenegraph/data/shape/shape_multiline.qml @@ -1,48 +1,65 @@ // Copyright (C) 2019 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only import QtQuick 2.14 -import QtQuick.Shapes 1.14 +import QtQuick.Shapes 6.6 Item { id: root width: 320 - height: 320 - - Shape { - vendorExtensionsEnabled: false - anchors.fill: parent - - ShapePath { - strokeWidth: 1 - strokeColor: "red" - fillColor: Qt.rgba(1,0,0,0.3) - scale: Qt.size(root.width - 1, root.height - 1) - PathMultiline { - paths: [ - [Qt.point(0.5, 0.06698), - Qt.point(1, 0.93301), - Qt.point(0, 0.93301), - Qt.point(0.5, 0.06698)], - - [Qt.point(0.5, 0.12472), - Qt.point(0.95, 0.90414), - Qt.point(0.05, 0.90414), - Qt.point(0.5, 0.12472)], - - [Qt.point(0.47131, 0.32986), - Qt.point(0.36229, 0.64789), - Qt.point(0.51492, 0.58590), - Qt.point(0.47563, 0.76014), - Qt.point(0.44950, 0.73590), - Qt.point(0.46292, 0.83392), - Qt.point(0.52162, 0.75190), - Qt.point(0.48531, 0.76230), - Qt.point(0.57529, 0.53189), - Qt.point(0.41261, 0.59189), - Qt.point(0.53001, 0.32786), - Qt.point(0.47131, 0.32986)] - ] + height: 480 + + ListModel { + id: renderers + ListElement { renderer: Shape.GeometryRenderer } + ListElement { renderer: Shape.CurveRenderer } + } + + Column { + Repeater { + model: renderers + Item { + x: 20 + width: root.width + height: root.height / 2 + + Shape { + anchors.fill: parent + preferredRendererType: renderer + + ShapePath { + strokeWidth: 1 + strokeColor: "red" + fillColor: Qt.rgba(1,0,0,0.3) + scale: Qt.size(root.height / 2, root.height / 2) + PathMultiline { + paths: [ + [Qt.point(0.5, 0.06698), + Qt.point(1, 0.93301), + Qt.point(0, 0.93301), + Qt.point(0.5, 0.06698)], + + [Qt.point(0.5, 0.12472), + Qt.point(0.95, 0.90414), + Qt.point(0.05, 0.90414), + Qt.point(0.5, 0.12472)], + + [Qt.point(0.47131, 0.32986), + Qt.point(0.36229, 0.64789), + Qt.point(0.51492, 0.58590), + Qt.point(0.47563, 0.76014), + Qt.point(0.44950, 0.73590), + Qt.point(0.46292, 0.83392), + Qt.point(0.52162, 0.75190), + Qt.point(0.48531, 0.76230), + Qt.point(0.57529, 0.53189), + Qt.point(0.41261, 0.59189), + Qt.point(0.53001, 0.32786), + Qt.point(0.47131, 0.32986)] + ] + } + } + } } } } diff --git a/tests/baseline/scenegraph/data/shape/shape_order.qml b/tests/baseline/scenegraph/data/shape/shape_order.qml new file mode 100644 index 0000000000..14d2a322f9 --- /dev/null +++ b/tests/baseline/scenegraph/data/shape/shape_order.qml @@ -0,0 +1,12 @@ +import QtQuick + +Item { + width: 320 + height: 480 + + OrderedPaths { + anchors.fill: parent + async: false + } +} + diff --git a/tests/baseline/scenegraph/data/shape/shape_order2.qml b/tests/baseline/scenegraph/data/shape/shape_order2.qml new file mode 100644 index 0000000000..1887cc527e --- /dev/null +++ b/tests/baseline/scenegraph/data/shape/shape_order2.qml @@ -0,0 +1,91 @@ +import QtQuick +import QtQuick.Shapes + +Item { + id: root + width: 320 + height: 480 + + property int counter: 0 + NumberAnimation { + target: root + property: "counter" + duration: 150 + from: 0 + to: 1 + running: true + } + + component MyShapes : Item { + width: 100 + height: 200 + property bool async: false + property int preferredRenderer: Shape.GeometryRenderer + + Shape { + id: s1 + asynchronous: parent.async + preferredRendererType: parent.preferredRenderer + ShapePath { + id: p1 + fillColor: "orange" + strokeColor: counter < 1 ? "transparent" : "lime" + strokeWidth: 10 + strokeStyle: ShapePath.DashLine + PathAngleArc { + centerX: 50 + centerY: 50 + radiusX: 40 + radiusY: 40 + sweepAngle: 270 + } + } + } + + Shape { + id: s2 + y: 100 + asynchronous: parent.async + preferredRendererType: parent.preferredRenderer + ShapePath { + id: p2 + fillColor: counter < 1 ? "transparent" : "orange" + strokeColor: "lime" + strokeWidth: 10 + strokeStyle: ShapePath.DashLine + PathAngleArc { + moveToStart: true + centerX: 50 + centerY: 50 + radiusX: 40 + radiusY: 40 + sweepAngle: 270 + } + } + } + } + + ListModel { + id: renderers + ListElement { renderer: Shape.GeometryRenderer } + ListElement { renderer: Shape.CurveRenderer } + } + + Row { + spacing: 25 + Repeater { + model: renderers + Column { + spacing: 25 + MyShapes { + async: false + preferredRenderer: renderer + } + MyShapes { + async: true + preferredRenderer: renderer + } + } + } + } +} diff --git a/tests/baseline/scenegraph/data/shape/shape_order_async.qml b/tests/baseline/scenegraph/data/shape/shape_order_async.qml new file mode 100644 index 0000000000..5dc96721b3 --- /dev/null +++ b/tests/baseline/scenegraph/data/shape/shape_order_async.qml @@ -0,0 +1,12 @@ +import QtQuick + +Item { + width: 320 + height: 480 + + OrderedPaths { + anchors.fill: parent + async: true + } +} + diff --git a/tests/baseline/scenegraph/data/shape/shape_quad.qml b/tests/baseline/scenegraph/data/shape/shape_quad.qml index a4c95f7c15..05d2b2519b 100644 --- a/tests/baseline/scenegraph/data/shape/shape_quad.qml +++ b/tests/baseline/scenegraph/data/shape/shape_quad.qml @@ -1,30 +1,41 @@ import QtQuick 2.9 -import QtQuick.Shapes 1.0 +import QtQuick.Shapes 6.6 Item { width: 320 height: 480 - Column { + ListModel { + id: renderers + ListElement { renderer: Shape.GeometryRenderer } + ListElement { renderer: Shape.CurveRenderer } + } + + Row { Repeater { - model: 4 - Item { - width: 200 - height: 100 + model: renderers + Column { + Repeater { + model: 4 + Item { + width: 160 + height: 100 - Shape { - anchors.fill: parent - vendorExtensionsEnabled: false + Shape { + anchors.fill: parent + preferredRendererType: renderer - ShapePath { - strokeWidth: (model.index + 2) * 2 - strokeColor: "black" - fillColor: "lightBlue" + ShapePath { + strokeWidth: (model.index + 2) * 2 + strokeColor: "black" + fillColor: "lightBlue" - startX: 50; startY: 100 - PathQuad { - x: 150; y: 100 - controlX: model.index * 10; controlY: model.index * 5 + startX: 30; startY: 100 + PathQuad { + x: 130; y: 100 + controlX: model.index * 10; controlY: model.index * 5 + } + } } } } diff --git a/tests/baseline/scenegraph/data/shape/shape_rectangle.qml b/tests/baseline/scenegraph/data/shape/shape_rectangle.qml new file mode 100644 index 0000000000..50e2895f85 --- /dev/null +++ b/tests/baseline/scenegraph/data/shape/shape_rectangle.qml @@ -0,0 +1,151 @@ +import QtQuick +import QtQuick.Shapes + +Rectangle { + width: 320 + height: 480 + color: "lightgray" + + ListModel { + id: renderers + ListElement { renderer: Shape.GeometryRenderer } + ListElement { renderer: Shape.CurveRenderer } + } + + Row { + padding: 10 + Repeater { + model: renderers + Column { + spacing: 10 + Shape { + width: 160 + preferredRendererType: renderer + + ShapePath { + fillColor: "transparent" + strokeColor: "blue" + strokeWidth: 1 + + PathRectangle { + x: 20; y: 0 + width: 100; height: 20 + } + + PathRectangle { + x: 20.5; y: 30.5 + width: 100; height: 20 + } + } + } + + Shape { + width: 160 + preferredRendererType: renderer + + ShapePath { + fillColor: "yellow" + strokeColor: "transparent" + + PathRectangle { + x: 20; y: 0 + width: 100; height: 20 + } + + PathRectangle { + x: 20.5; y: 30.5 + width: 100; height: 20 + } + } + } + + Shape { + width: 160 + preferredRendererType: renderer + + ShapePath { + fillColor: "yellow" + strokeColor: "green" + strokeWidth: 5 + joinStyle: ShapePath.RoundJoin + + PathRectangle { + x: 20; y: 00 + width: 100; height: 20 + } + + PathRectangle { + x: 20; y: 30 + width: 100; height: 20 + radius: 5 + } + } + + ShapePath { + fillColor: "yellow" + strokeColor: "green" + strokeWidth: 5 + joinStyle: ShapePath.MiterJoin + + PathRectangle { + x: 20; y: 60 + width: 100; height: 20 + } + + PathRectangle { + x: 20; y: 90 + width: 100; height: 20 + radius: 5 + } + + PathRectangle { + x: 20; y: 120 + width: 100; height: 20 + radius: 50 + } + + PathRectangle { + x: 20; y: 150 + width: 100; height: 30 + radius: 10 + topLeftRadius: 50 + bottomRightRadius: 5 + bottomLeftRadius: 0 + } + } + } + + Rectangle { + id: rect + width: 120 + height: 60 + color: "white" + border.width: 20 + border.color: "blue" + topRightRadius: 30 + } + + Shape { + width: 160 + preferredRendererType: renderer + + ShapePath { + id: myPath + fillColor: rect.color + strokeColor: rect.border.color + strokeWidth: rect.border.width + joinStyle: ShapePath.MiterJoin + + PathRectangle { + width: rect.width + height: rect.height + topRightRadius: rect.topRightRadius + strokeAdjustment: myPath.strokeWidth + } + } + } + } + } + } +} + diff --git a/tests/baseline/scenegraph/data/shape/shape_spread.qml b/tests/baseline/scenegraph/data/shape/shape_spread.qml index f310f08773..dffa4a1bae 100644 --- a/tests/baseline/scenegraph/data/shape/shape_spread.qml +++ b/tests/baseline/scenegraph/data/shape/shape_spread.qml @@ -1,33 +1,44 @@ import QtQuick 2.9 -import QtQuick.Shapes 1.0 +import QtQuick.Shapes 6.6 Item { width: 320 height: 480 - Column { + ListModel { + id: renderers + ListElement { renderer: Shape.GeometryRenderer } + ListElement { renderer: Shape.CurveRenderer } + } + + Row { Repeater { - model: 3 - Shape { - vendorExtensionsEnabled: false - width: 200 - height: 150 - ShapePath { - strokeColor: "transparent" + model: renderers + Column { + Repeater { + model: 3 + Shape { + preferredRendererType: renderer + width: 160 + height: 150 + ShapePath { + strokeColor: "transparent" - fillGradient: LinearGradient { - id: grad - y1: 50; y2: 80 - spread: model.index === 0 ? ShapeGradient.PadSpread : (model.index === 1 ? ShapeGradient.RepeatSpread : ShapeGradient.ReflectSpread) - GradientStop { position: 0; color: "black" } - GradientStop { position: 1; color: "red" } - } + fillGradient: LinearGradient { + id: grad + y1: 50; y2: 80 + spread: model.index === 0 ? ShapeGradient.PadSpread : (model.index === 1 ? ShapeGradient.RepeatSpread : ShapeGradient.ReflectSpread) + GradientStop { position: 0; color: "black" } + GradientStop { position: 1; color: "red" } + } - startX: 10; startY: 10 - PathLine { relativeX: 180; relativeY: 0 } - PathLine { relativeX: 0; relativeY: 100 } - PathLine { relativeX: -180; relativeY: 0 } - PathLine { relativeX: 0; relativeY: -100 } + startX: 10; startY: 10 + PathLine { relativeX: 140; relativeY: 0 } + PathLine { relativeX: 0; relativeY: 100 } + PathLine { relativeX: -140; relativeY: 0 } + PathLine { relativeX: 0; relativeY: -100 } + } + } } } } diff --git a/tests/baseline/scenegraph/data/shape/shape_spread_xf.qml b/tests/baseline/scenegraph/data/shape/shape_spread_xf.qml new file mode 100644 index 0000000000..c9f67e472d --- /dev/null +++ b/tests/baseline/scenegraph/data/shape/shape_spread_xf.qml @@ -0,0 +1,47 @@ +import QtQuick +import QtQuick.Shapes + +Item { + width: 320 + height: 480 + + ListModel { + id: renderers + ListElement { renderer: Shape.GeometryRenderer } + ListElement { renderer: Shape.CurveRenderer } + } + + Row { + Repeater { + model: renderers + Column { + Repeater { + model: 3 + Shape { + preferredRendererType: renderer + width: 160 + height: 150 + ShapePath { + strokeColor: "transparent" + + fillGradient: LinearGradient { + id: grad + y1: 50; y2: 80 + spread: model.index === 0 ? ShapeGradient.PadSpread : (model.index === 1 ? ShapeGradient.RepeatSpread : ShapeGradient.ReflectSpread) + GradientStop { position: 0; color: "black" } + GradientStop { position: 1; color: "red" } + } + fillTransform: PlanarTransform.fromShear(0, 0.2) + + startX: 10; startY: 10 + PathLine { relativeX: 140; relativeY: 0 } + PathLine { relativeX: 0; relativeY: 100 } + PathLine { relativeX: -140; relativeY: 0 } + PathLine { relativeX: 0; relativeY: -100 } + } + } + } + } + } + } +} diff --git a/tests/baseline/scenegraph/data/shape/shape_text.qml b/tests/baseline/scenegraph/data/shape/shape_text.qml index 37367054b5..427c78c8d0 100644 --- a/tests/baseline/scenegraph/data/shape/shape_text.qml +++ b/tests/baseline/scenegraph/data/shape/shape_text.qml @@ -1,88 +1,99 @@ import QtQuick 2.15 -import QtQuick.Shapes 1.0 +import QtQuick.Shapes 6.6 Item { width: 320 height: 480 - Column { - Item { - width: 200 - height: 160 + ListModel { + id: renderers + ListElement { renderer: Shape.GeometryRenderer } + ListElement { renderer: Shape.CurveRenderer } + } + + Row { + Repeater { + model: renderers + Column { + Item { + width: 160 + height: 160 - Shape { - anchors.fill: parent - vendorExtensionsEnabled: false + Shape { + anchors.fill: parent + preferredRendererType: renderer - ShapePath { - fillColor: "transparent" - strokeColor: "blue" - strokeStyle: ShapePath.DashLine - strokeWidth: 4 + ShapePath { + fillColor: "transparent" + strokeColor: "blue" + strokeStyle: ShapePath.DashLine + strokeWidth: 4 - PathText { - x: 96 - y: 10 - font.pixelSize: 120 - text: "Qt" + PathText { + x: 24 + y: 10 + font.pixelSize: 96 + text: "Qt" + } + } } } - } - } - Item { - width: 200 - height: 160 + Item { + width: 100 + height: 160 - Rectangle { - anchors.fill: parent - color: "blue" - } + Rectangle { + anchors.fill: parent + color: "blue" + } - Shape { - anchors.fill: parent - vendorExtensionsEnabled: false + Shape { + anchors.fill: parent + preferredRendererType: renderer - ShapePath { - fillColor: "red" - strokeColor: "blue" - strokeStyle: ShapePath.DashLine - capStyle: ShapePath.RoundCap - strokeWidth: 8 + ShapePath { + fillColor: "red" + strokeColor: "blue" + strokeStyle: ShapePath.DashLine + capStyle: ShapePath.RoundCap + strokeWidth: 4 - PathText { - x: 96; y: 10 - font.pixelSize: 150 - text: "Qt" + PathText { + x: 24; y: 10 + font.pixelSize: 96 + text: "Qt" + } + } } } - } - } - Item { - width: 200 - height: 160 + Item { + width: 160 + height: 160 - Shape { - anchors.fill: parent - vendorExtensionsEnabled: false + Shape { + anchors.fill: parent + preferredRendererType: renderer - ShapePath { - fillGradient: LinearGradient { - x1: 0; x2: 200; y1: 0; y2: 160 - spread: ShapeGradient.PadSpread - GradientStop { position: 0.0; color: "red"; } - GradientStop { position: 1.0; color: "green"; } - } - strokeColor: "blue" - strokeStyle: ShapePath.DashLine - joinStyle: ShapePath.RoundJoin - strokeWidth: 4 + ShapePath { + fillGradient: LinearGradient { + x1: 0; x2: 200; y1: 0; y2: 160 + spread: ShapeGradient.PadSpread + GradientStop { position: 0.0; color: "red"; } + GradientStop { position: 1.0; color: "green"; } + } + strokeColor: "blue" + strokeStyle: ShapePath.DashLine + joinStyle: ShapePath.RoundJoin + strokeWidth: 4 - PathText { - x: 96; y: 10 - font.pixelSize: 150 - text: "Qt" + PathText { + x: 24; y: 10 + font.pixelSize: 96 + text: "Qt" + } + } } } } diff --git a/tests/baseline/scenegraph/data/shape/shape_updatecolor.qml b/tests/baseline/scenegraph/data/shape/shape_updatecolor.qml new file mode 100644 index 0000000000..32cc73ad45 --- /dev/null +++ b/tests/baseline/scenegraph/data/shape/shape_updatecolor.qml @@ -0,0 +1,77 @@ +import QtQuick +import QtQuick.Shapes + +Item { + width: 320 + height: 800 + + ListModel { + id: renderers + ListElement { renderer: Shape.GeometryRenderer } + ListElement { renderer: Shape.CurveRenderer } + } + + Row { + Repeater { + model: renderers + Column { + Shape { + preferredRendererType: renderer + width: 160 + height: 150 + + ShapePath { + strokeColor: "transparent" + fillColor: "red" + + startX: 10; startY: 10 + PathLine { relativeX: 140; relativeY: 0 } + PathLine { relativeX: 0; relativeY: 100 } + PathLine { relativeX: -140; relativeY: 0 } + PathLine { relativeX: 0; relativeY: -100 } + } + } + + Shape { + preferredRendererType: renderer + width: 160 + height: 150 + + ShapePath { + strokeColor: "transparent" + fillColor: "red" + + startX: 10; startY: 10 + 1 * 140 + PathLine { relativeX: 140; relativeY: 0 } + PathLine { relativeX: 0; relativeY: 100 } + PathLine { relativeX: -140; relativeY: 0 } + PathLine { relativeX: 0; relativeY: -100 } + } + } + + Shape { + preferredRendererType: renderer + width: 160 + height: 150 + Timer { + interval: 100 + running: true + onTriggered: s.fillColor = Qt.rgba(0, 1, 0, 1) + } + + ShapePath { + id: s + strokeColor: "transparent" + fillColor: "red" + + startX: 10; startY: 10 + 2 * 140 + PathLine { relativeX: 140; relativeY: 0 } + PathLine { relativeX: 0; relativeY: 100 } + PathLine { relativeX: -140; relativeY: 0 } + PathLine { relativeX: 0; relativeY: -100 } + } + } + } + } + } +} diff --git a/tests/baseline/scenegraph/data/shape/shape_updatefill.qml b/tests/baseline/scenegraph/data/shape/shape_updatefill.qml new file mode 100644 index 0000000000..8e034c7676 --- /dev/null +++ b/tests/baseline/scenegraph/data/shape/shape_updatefill.qml @@ -0,0 +1,214 @@ +import QtQuick +import QtQuick.Shapes + +Rectangle { + width: 320 + height: 480 + color: "lightgray" + + ListModel { + id: renderers + ListElement { renderer: Shape.GeometryRenderer } + ListElement { renderer: Shape.CurveRenderer } + } + + LinearGradient { + id: grad1 + x2: 60; y2: 60 + GradientStop { position: 0; color: "black" } + GradientStop { position: 1; color: "red" } + } + + ConicalGradient { + id: grad2 + centerX: 15; centerY: 15 + GradientStop { position: 0; color: "yellow" } + GradientStop { position: .5; color: "black" } + GradientStop { position: 1; color: "yellow" } + } + + Image { + id: img1 + source: "../shared/world.png" + visible: false + } + + Image { + id: img2 + source: "../shared/sample_1.png" + visible: false + } + + Row { + padding: 10 + spacing: 20 + Repeater { + model: renderers + Shape { + width: 140 + preferredRendererType: renderer + + ShapePath { + id: c1 + strokeColor: "black" + fillColor: "cyan" + fillTransform: PlanarTransform.fromTranslate(rc1.x, rc1.y) + + PathRectangle { + id: rc1 + width: 60; height: 60 + } + } + + ShapePath { + id: c2 + strokeColor: "black" + fillColor: "cyan" + fillTransform: PlanarTransform.fromTranslate(rc2.x, rc2.y) + + PathRectangle { + id: rc2 + x: 80 + width: 60; height: 60 + } + } + + ShapePath { + id: g1 + strokeColor: "black" + fillColor: "cyan" + fillTransform: PlanarTransform.fromTranslate(rg1.x, rg1.y) + fillGradient: grad1 + + PathRectangle { + id: rg1 + y: 80 + width: 60; height: 60 + } + } + + ShapePath { + id: t1 + strokeColor: "black" + fillColor: "cyan" + fillItem: img1 + fillTransform: PlanarTransform.fromTranslate(rt1.x, rt1.y) + + PathRectangle { + id: rt1 + x: 80; y: 80 + width: 60; height: 60 + } + } + + ShapePath { + id: g2 + strokeColor: "black" + fillColor: "cyan" + fillTransform: PlanarTransform.fromTranslate(rg2.x, rg2.y) + fillGradient: grad1 + + PathRectangle { + id: rg2 + y: 2 * 80 + width: 60; height: 60 + } + } + + ShapePath { + id: t2 + strokeColor: "black" + fillColor: "cyan" + fillTransform: PlanarTransform.fromTranslate(rt2.x, rt2.y) + fillItem: img1 + + PathRectangle { + id: rt2 + x: 80; y: 2 * 80 + width: 60; height: 60 + } + } + + ShapePath { + id: g3 + strokeColor: "black" + fillColor: "cyan" + fillTransform: PlanarTransform.fromTranslate(rg3.x, rg3.y) + fillGradient: grad1 + + PathRectangle { + id: rg3 + y: 3 * 80 + width: 60; height: 60 + } + } + + ShapePath { + id: t3 + strokeColor: "black" + fillColor: "cyan" + fillTransform: PlanarTransform.fromTranslate(rt3.x, rt3.y) + fillItem: img1 + + PathRectangle { + id: rt3 + x: 80; y: 3 * 80 + width: 60; height: 60 + } + } + + ShapePath { + id: g4 + strokeColor: "black" + fillColor: "cyan" + fillTransform: PlanarTransform.fromTranslate(rg4.x, rg4.y) + fillGradient: grad2 + + PathRectangle { + id: rg4 + y: 4 * 80 + width: 60; height: 60 + } + } + + ShapePath { + id: t4 + strokeColor: "black" + fillColor: "cyan" + fillTransform: PlanarTransform.fromTranslate(rt4.x, rt4.y) + fillItem: img2 + + PathRectangle { + id: rt4 + x: 80; y: 4 * 80 + width: 60; height: 60 + } + } + + Timer { + running: true + interval: 150 // <200ms needed for scenegrabber; disable for manual testing + onTriggered: { + // Test all changes A->B, where A,B in {fillColor, fillGradient, fillItem} + // plus change of fillTransform + + c1.fillGradient = grad1 + g1.fillGradient = null + g2.fillGradient = null + g2.fillItem = img1 + g3.fillGradient = grad2 + + c2.fillItem = img1 + t1.fillItem = null + t2.fillGradient = grad1 + t3.fillItem = img2 + + g4.fillTransform = g4.fillTransform.times(PlanarTransform.fromRotate(45, 30, 30)) + t4.fillTransform = t4.fillTransform.times(PlanarTransform.fromRotate(45, 30, 30)) + } + } + } + } + } +} + diff --git a/tests/baseline/scenegraph/data/shape/shape_updategradient.qml b/tests/baseline/scenegraph/data/shape/shape_updategradient.qml new file mode 100644 index 0000000000..f1fa0f0f3d --- /dev/null +++ b/tests/baseline/scenegraph/data/shape/shape_updategradient.qml @@ -0,0 +1,105 @@ +import QtQuick +import QtQuick.Shapes + +Item { + width: 320 + height: 800 + + ListModel { + id: renderers + ListElement { renderer: Shape.GeometryRenderer } + ListElement { renderer: Shape.CurveRenderer } + } + + RadialGradient { + id: radialGradient + centerX: 80 + centerY: 75 + centerRadius: centerY + focalX: centerX + focalY: centerY + GradientStop { position: 0; color: "black" } + GradientStop { position: .5; color: "cyan" } + GradientStop { position: 1; color: "black" } + } + + Row { + Repeater { + model: renderers + Column { + Shape { + preferredRendererType: renderer + width: 160 + height: 150 + + ShapePath { + strokeColor: "transparent" + fillGradient: LinearGradient { + y1: 50; y2: 80 + GradientStop { position: 0; color: "black" } + GradientStop { position: 1; color: "cyan" } + } + fillTransform: PlanarTransform.fromAffineMatrix(0.8, 0.2, 0.3, 1.5, 20, -50 + startY) + + startX: 10; startY: 10 + PathLine { relativeX: 140; relativeY: 0 } + PathLine { relativeX: 0; relativeY: 100 } + PathLine { relativeX: -140; relativeY: 0 } + PathLine { relativeX: 0; relativeY: -100 } + } + } + + Shape { + preferredRendererType: renderer + width: 160 + height: 150 + + ShapePath { + strokeColor: "transparent" + fillGradient: LinearGradient { + y1: 50; y2: 80 + GradientStop { position: 0; color: "black" } + GradientStop { position: 1; color: "cyan" } + } + fillTransform: PlanarTransform.fromAffineMatrix(0.8, 0.2, 0.3, 1.5, 20, -50 + startY) + + startX: 10; startY: 10 + 1 * 140 + PathLine { relativeX: 140; relativeY: 0 } + PathLine { relativeX: 0; relativeY: 100 } + PathLine { relativeX: -140; relativeY: 0 } + PathLine { relativeX: 0; relativeY: -100 } + } + } + + Shape { + preferredRendererType: renderer + width: 160 + height: 150 + Timer { + interval: 100 + running: true + onTriggered: s.fillGradient = radialGradient + } + + ShapePath { + id: s + strokeColor: "transparent" + fillGradient: LinearGradient { + y1: 50; y2: 80 + GradientStop { position: 0; color: "black" } + GradientStop { position: 1; color: "cyan" } + } + fillTransform: PlanarTransform.fromAffineMatrix(0.8, 0.2, 0.3, 1.5, 20, -50 + startY) + + + startX: 10; startY: 10 + 2 * 140 + PathLine { relativeX: 140; relativeY: 0 } + PathLine { relativeX: 0; relativeY: 100 } + PathLine { relativeX: -140; relativeY: 0 } + PathLine { relativeX: 0; relativeY: -100 } + } + } + } + } + } +} |