Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qquickellipseshape_p.h
Go to the documentation of this file.
1// Copyright (C) 2025 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QQUICKELLIPSESHAPE_P_H
5#define QQUICKELLIPSESHAPE_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <QtQuickShapes/private/qquickshape_p.h>
19#include <QtQuickShapesDesignHelpers/qtquickshapesdesignhelpersexports.h>
20
21QT_BEGIN_NAMESPACE
22
23class QQuickEllipseShapePrivate;
24
25class Q_QUICKSHAPESDESIGNHELPERS_EXPORT QQuickEllipseShape : public QQuickShape
26{
27public:
28 Q_OBJECT
29 Q_PROPERTY(qreal sweepAngle READ sweepAngle WRITE setSweepAngle NOTIFY sweepAngleChanged FINAL)
30 Q_PROPERTY(qreal startAngle READ startAngle WRITE setStartAngle NOTIFY startAngleChanged FINAL)
31 Q_PROPERTY(qreal dashOffset READ dashOffset WRITE setDashOffset NOTIFY dashOffsetChanged FINAL)
32 Q_PROPERTY(qreal innerArcRatio READ innerArcRatio WRITE setInnerArcRatio NOTIFY
33 innerArcRatioChanged FINAL)
34 Q_PROPERTY(qreal cornerRadius READ cornerRadius WRITE setCornerRadius NOTIFY cornerRadiusChanged
35 FINAL)
36 Q_PROPERTY(
37 qreal strokeWidth READ strokeWidth WRITE setStrokeWidth NOTIFY strokeWidthChanged FINAL)
38 Q_PROPERTY(QColor fillColor READ fillColor WRITE setFillColor NOTIFY fillColorChanged FINAL)
39 Q_PROPERTY(QColor strokeColor READ strokeColor WRITE setStrokeColor NOTIFY strokeColorChanged
40 FINAL)
41 Q_PROPERTY(QQuickShapePath::CapStyle capStyle READ capStyle WRITE setCapStyle NOTIFY
42 capStyleChanged FINAL)
43 Q_PROPERTY(QQuickShapePath::JoinStyle joinStyle READ joinStyle WRITE setJoinStyle NOTIFY
44 joinStyleChanged FINAL)
45 Q_PROPERTY(QQuickShapePath::StrokeStyle strokeStyle READ strokeStyle WRITE setStrokeStyle NOTIFY
46 strokeStyleChanged FINAL)
47 Q_PROPERTY(QQuickShapePath::FillRule fillRule READ fillRule WRITE setFillRule NOTIFY
48 fillRuleChanged FINAL)
49 Q_PROPERTY(QList<qreal> dashPattern READ dashPattern WRITE setDashPattern NOTIFY
50 dashPatternChanged FINAL)
51 Q_PROPERTY(QQuickShapeGradient *fillGradient READ fillGradient WRITE setFillGradient NOTIFY
52 gradientChanged RESET resetFillGradient FINAL)
53 Q_PROPERTY(BorderMode borderMode READ borderMode WRITE setBorderMode NOTIFY borderModeChanged
54 RESET resetBorderMode FINAL)
55
56 QML_NAMED_ELEMENT(EllipseShape)
57 QML_ADDED_IN_VERSION(6, 11)
58
59public:
60 QQuickEllipseShape(QQuickItem *parent = nullptr);
61 ~QQuickEllipseShape() override;
62
63 qreal sweepAngle() const;
64 void setSweepAngle(qreal sweepAngle);
65
66 qreal startAngle() const;
67 void setStartAngle(qreal startAngle);
68
69 qreal dashOffset() const;
70 void setDashOffset(qreal offset);
71
72 qreal innerArcRatio() const;
73 void setInnerArcRatio(qreal innerArcRatio);
74
75 qreal cornerRadius() const;
76 void setCornerRadius(qreal cornerRadius);
77
78 qreal strokeWidth() const;
79 void setStrokeWidth(qreal width);
80
81 QColor fillColor() const;
82 void setFillColor(const QColor &color);
83
84 QColor strokeColor() const;
85 void setStrokeColor(const QColor &color);
86
87 QQuickShapePath::CapStyle capStyle() const;
88 void setCapStyle(QQuickShapePath::CapStyle style);
89
90 QQuickShapePath::JoinStyle joinStyle() const;
91 void setJoinStyle(QQuickShapePath::JoinStyle style);
92
93 QQuickShapePath::StrokeStyle strokeStyle() const;
94 void setStrokeStyle(QQuickShapePath::StrokeStyle style);
95
96 QQuickShapePath::FillRule fillRule() const;
97 void setFillRule(QQuickShapePath::FillRule fillRule);
98
99 QList<qreal> dashPattern() const;
100 void setDashPattern(const QList<qreal> &array);
101
102 QQuickShapeGradient *fillGradient() const;
103 void setFillGradient(QQuickShapeGradient *fillGradient);
104 void resetFillGradient();
106 enum class BorderMode { Inside, Middle, Outside };
107 Q_ENUM(BorderMode)
108 BorderMode borderMode() const;
109 void setBorderMode(BorderMode borderMode);
110 void resetBorderMode();
112Q_SIGNALS:
113 void innerArcRatioChanged();
114 void cornerRadiusChanged();
115 void startAngleChanged();
116 void sweepAngleChanged();
117 void strokeColorChanged();
118 void strokeWidthChanged();
119 void fillColorChanged();
120 void joinStyleChanged();
121 void capStyleChanged();
122 void fillRuleChanged();
123 void strokeStyleChanged();
124 void dashOffsetChanged();
125 void dashPatternChanged();
126 void gradientChanged();
127 void borderModeChanged();
128
129protected:
130 void itemChange(ItemChange change, const ItemChangeData &value) override;
131
132private:
133 Q_DISABLE_COPY(QQuickEllipseShape)
134 Q_DECLARE_PRIVATE(QQuickEllipseShape)
135};
136
137QT_END_NAMESPACE
138
139#endif // QQUICKELLIPSE1SHAPE_P_H
qreal angle_between_vectors(QVector2D a, QVector2D b)
qreal cross(QVector2D a, QVector2D b)
qreal arc_angle(qreal angle)
QVector2D tangent_ccw(QVector2D radius, qreal angle)
bool lines_intersect(QVector2D a, QVector2D b, QVector2D c, QVector2D d, qreal *s, qreal *t)
qreal cross(QVector2D a, QVector2D b, QVector2D c, QVector2D d)
bool is_equal(qreal a, qreal b, qreal epsilon=DBL_EPSILON)
QVector2D arc_point(QVector2D center, QVector2D radius, qreal angle)