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(bool hideLine READ hideLine WRITE setHideLine NOTIFY hideLineChanged FINAL)
39 Q_PROPERTY(QColor fillColor READ fillColor WRITE setFillColor NOTIFY fillColorChanged FINAL)
40 Q_PROPERTY(QColor strokeColor READ strokeColor WRITE setStrokeColor NOTIFY strokeColorChanged
41 FINAL)
42 Q_PROPERTY(QQuickShapePath::CapStyle capStyle READ capStyle WRITE setCapStyle NOTIFY
43 capStyleChanged FINAL)
44 Q_PROPERTY(QQuickShapePath::JoinStyle joinStyle READ joinStyle WRITE setJoinStyle NOTIFY
45 joinStyleChanged FINAL)
46 Q_PROPERTY(QQuickShapePath::StrokeStyle strokeStyle READ strokeStyle WRITE setStrokeStyle NOTIFY
47 strokeStyleChanged FINAL)
48 Q_PROPERTY(QQuickShapePath::FillRule fillRule READ fillRule WRITE setFillRule NOTIFY
49 fillRuleChanged FINAL)
50 Q_PROPERTY(QVector<qreal> dashPattern READ dashPattern WRITE setDashPattern NOTIFY
51 dashPatternChanged FINAL)
52 Q_PROPERTY(QQuickShapeGradient *fillGradient READ fillGradient WRITE setFillGradient NOTIFY
53 gradientChanged RESET resetFillGradient FINAL)
54 Q_PROPERTY(BorderMode borderMode READ borderMode WRITE setBorderMode NOTIFY borderModeChanged
55 RESET resetBorderMode FINAL)
56
57 QML_NAMED_ELEMENT(EllipseShape)
58 QML_ADDED_IN_VERSION(6, 10)
59
60public:
61 QQuickEllipseShape(QQuickItem *parent = nullptr);
62 ~QQuickEllipseShape() override;
63
64 qreal sweepAngle() const;
65 void setSweepAngle(qreal sweepAngle);
66
67 qreal startAngle() const;
68 void setStartAngle(qreal startAngle);
69
70 qreal dashOffset() const;
71 void setDashOffset(qreal offset);
72
73 qreal innerArcRatio() const;
74 void setInnerArcRatio(qreal innerArcRatio);
75
76 qreal cornerRadius() const;
77 void setCornerRadius(qreal cornerRadius);
78
79 qreal strokeWidth() const;
80 void setStrokeWidth(qreal width);
81
82 bool hideLine() const;
83 void setHideLine(bool hideLine);
84
85 QColor fillColor() const;
86 void setFillColor(const QColor &color);
87
88 QColor strokeColor() const;
89 void setStrokeColor(const QColor &color);
90
91 QQuickShapePath::CapStyle capStyle() const;
92 void setCapStyle(QQuickShapePath::CapStyle style);
93
94 QQuickShapePath::JoinStyle joinStyle() const;
95 void setJoinStyle(QQuickShapePath::JoinStyle style);
96
97 QQuickShapePath::StrokeStyle strokeStyle() const;
98 void setStrokeStyle(QQuickShapePath::StrokeStyle style);
99
100 QQuickShapePath::FillRule fillRule() const;
101 void setFillRule(QQuickShapePath::FillRule fillRule);
102
103 QVector<qreal> dashPattern() const;
104 void setDashPattern(const QVector<qreal> &array);
105
106 QQuickShapeGradient *fillGradient() const;
107 void setFillGradient(QQuickShapeGradient *fillGradient);
108 void resetFillGradient();
109
110 enum class BorderMode { Inside, Middle, Outside };
111 Q_ENUM(BorderMode)
112 BorderMode borderMode() const;
113 void setBorderMode(BorderMode borderMode);
114 void resetBorderMode();
115
116Q_SIGNALS:
117 void innerArcRatioChanged();
118 void cornerRadiusChanged();
119 void hideLineChanged();
120 void startAngleChanged();
121 void sweepAngleChanged();
122 void strokeColorChanged();
123 void strokeWidthChanged();
124 void fillColorChanged();
125 void joinStyleChanged();
126 void capStyleChanged();
127 void fillRuleChanged();
128 void strokeStyleChanged();
129 void dashOffsetChanged();
130 void dashPatternChanged();
131 void gradientChanged();
132 void borderModeChanged();
133
134protected:
135 void itemChange(ItemChange change, const ItemChangeData &value) override;
136
137private:
138 Q_DISABLE_COPY(QQuickEllipseShape)
139 Q_DECLARE_PRIVATE(QQuickEllipseShape)
140};
141
142QT_END_NAMESPACE
143
144#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)