diff options
Diffstat (limited to 'tests/baseline/scenegraph/data/shape/shape_implicit_size.qml')
-rw-r--r-- | tests/baseline/scenegraph/data/shape/shape_implicit_size.qml | 91 |
1 files changed, 91 insertions, 0 deletions
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 + } + } + } + } + } +} |