26QQuickRectangleShape::QQuickRectangleShape(QQuickItem *parent)
27 : QQuickShape(*(
new QQuickRectangleShapePrivate), parent)
29 Q_D(QQuickRectangleShape);
31 setPreferredRendererType(CurveRenderer);
33 d->shapePath =
new QQuickShapePath(
this);
34 d->shapePath->setObjectName(
"rectangleShapeShapePath");
35 d->shapePath->setAsynchronous(
true);
36 d->shapePath->setStrokeWidth(4);
37 d->shapePath->setStrokeColor(QColorConstants::Black);
39 connect(d->shapePath, &QQuickShapePath::strokeColorChanged,
this, &QQuickRectangleShape::strokeColorChanged);
40 connect(d->shapePath, &QQuickShapePath::strokeWidthChanged,
this, &QQuickRectangleShape::strokeWidthChanged);
41 connect(d->shapePath, &QQuickShapePath::fillColorChanged,
this, &QQuickRectangleShape::fillColorChanged);
42 connect(d->shapePath, &QQuickShapePath::joinStyleChanged,
this, &QQuickRectangleShape::joinStyleChanged);
43 connect(d->shapePath, &QQuickShapePath::capStyleChanged,
this, &QQuickRectangleShape::capStyleChanged);
44 connect(d->shapePath, &QQuickShapePath::strokeStyleChanged,
this, &QQuickRectangleShape::strokeStyleChanged);
45 connect(d->shapePath, &QQuickShapePath::dashOffsetChanged,
this, &QQuickRectangleShape::dashOffsetChanged);
46 connect(d->shapePath, &QQuickShapePath::dashPatternChanged,
this, &QQuickRectangleShape::dashPatternChanged);
50 d->pathRectangle =
new QQuickPathRectangle(d->shapePath);
51 d->pathRectangle->setObjectName(
"topRightPathArc");
52 d->pathRectangle->setRadius(10);
53 connect(d->pathRectangle, &QQuickPathRectangle::radiusChanged,
this, &QQuickRectangleShape::radiusChanged);
54 connect(d->pathRectangle, &QQuickPathRectangle::topLeftRadiusChanged,
this, &QQuickRectangleShape::topLeftRadiusChanged);
55 connect(d->pathRectangle, &QQuickPathRectangle::topRightRadiusChanged,
this, &QQuickRectangleShape::topRightRadiusChanged);
56 connect(d->pathRectangle, &QQuickPathRectangle::bottomLeftRadiusChanged,
this, &QQuickRectangleShape::bottomLeftRadiusChanged);
57 connect(d->pathRectangle, &QQuickPathRectangle::bottomRightRadiusChanged,
this, &QQuickRectangleShape::bottomRightRadiusChanged);
58 connect(d->pathRectangle, &QQuickPathRectangle::bevelChanged,
this, &QQuickRectangleShape::bevelChanged);
59 connect(d->pathRectangle, &QQuickPathRectangle::topLeftBevelChanged,
this, &QQuickRectangleShape::topLeftBevelChanged);
60 connect(d->pathRectangle, &QQuickPathRectangle::topRightBevelChanged,
this, &QQuickRectangleShape::topRightBevelChanged);
61 connect(d->pathRectangle, &QQuickPathRectangle::bottomLeftBevelChanged,
this, &QQuickRectangleShape::bottomLeftBevelChanged);
62 connect(d->pathRectangle, &QQuickPathRectangle::bottomRightBevelChanged,
this, &QQuickRectangleShape::bottomRightBevelChanged);
67 d->updateStrokeAdjustment();
69 QQuickPathPrivate::get(d->shapePath)->appendPathElement(d->pathRectangle);
74 d->sp.append(d->shapePath);
76 d->shapePath->setParent(
this);
78 d->extra.value().resourcesList.append(d->shapePath);