26 Q_DECLARE_PUBLIC(QQuickEllipseShape)
29 QQuickEllipseShapePrivate();
30 ~QQuickEllipseShapePrivate() override;
34 void update(qreal diff, QVector2D a, QVector2D b, QVector2D c, qreal alpha, qreal radius)
40 this->radius = radius;
72 enum class RoundedCornerIndex { Center, InnerEnd, OuterEnd, InnerBegin, OuterBegin };
75 class RoundedCornerArray
78 RoundedCorner &operator[](RoundedCornerIndex index)
80 return array[
static_cast<
int>(index)];
85 for (
auto &rc : array)
90 RoundedCorner array[5];
93 void addLine(QVector2D point);
94 void addArc(QVector2D point, QVector2D arcRadius, QQuickPathArc::ArcDirection dir,
95 bool largeArc =
false);
97 qreal getBorderOffset()
const;
100 void roundCenter(QVector2D center, QVector2D ellipseRadius);
102 void roundBeginEnd(QVector2D center, QVector2D ellipseRadius);
104 bool roundOuter(QVector2D center, QVector2D ellipseRadius, qreal deg, qreal arcAngle1,
105 qreal arcAngle2, RoundedCornerIndex index);
107 bool roundInner(QVector2D center, QVector2D ellipseRadius, qreal deg, qreal arcAngle1,
108 qreal arcAngle2, RoundedCornerIndex index);
111 void drawCenterCorner();
113 void drawInnerEndCorner();
115 void drawInnerBeginCorner();
117 void drawOuterBeginCorner();
120 void drawOuterArcRounded(QVector2D center, QVector2D ellipseRadius);
122 void drawInnerArcRounded(QVector2D center, QVector2D ellipseRadius);
125 void drawOuterArc(QVector2D center, QVector2D ellipseRadius);
127 void drawFullInnerArc(QVector2D center, QVector2D ellipseRadius);
130 void drawWithInnerRadius(QVector2D center, QVector2D ellipseRadius);
132 void drawWithoutInnerRadius(QVector2D center, QVector2D ellipseRadius);
136 QQuickShapePath *path =
nullptr;
138 bool hideLine =
false;
140 qreal startAngle = 0;
141 qreal sweepAngle = 360;
142 qreal innerArcRatio = 0;
143 qreal cornerRadius = 10;
144 QQuickEllipseShape::BorderMode borderMode = QQuickEllipseShape::BorderMode::Inside;