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
qquickstarshape_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// Qt-Security score:significant reason:default
4
5#ifndef QQUICKSTARSHAPE_P_H
6#define QQUICKSTARSHAPE_P_H
7
8//
9// W A R N I N G
10// -------------
11//
12// This file is not part of the Qt API. It exists purely as an
13// implementation detail. This header file may change from version to
14// version without notice, or even be removed.
15//
16// We mean it.
17//
18
19#include <QtQuickShapes/private/qquickshape_p.h>
20#include <QtQuickShapesDesignHelpers/qtquickshapesdesignhelpersexports.h>
21
22QT_BEGIN_NAMESPACE
23
24class QQuickStarShapePrivate;
25
26class Q_QUICKSHAPESDESIGNHELPERS_EXPORT QQuickStarShape : public QQuickShape
27{
28public:
29 Q_OBJECT
30 Q_PROPERTY(qreal dashOffset READ dashOffset WRITE setDashOffset NOTIFY dashOffsetChanged FINAL)
31 Q_PROPERTY(qreal cornerRadius READ cornerRadius WRITE setCornerRadius NOTIFY cornerRadiusChanged
32 FINAL)
33 Q_PROPERTY(int pointCount READ pointCount WRITE setPointCount NOTIFY pointCountChanged FINAL)
34 Q_PROPERTY(qreal ratio READ ratio WRITE setRatio NOTIFY ratioChanged FINAL)
35 Q_PROPERTY(
36 qreal strokeWidth READ strokeWidth WRITE setStrokeWidth NOTIFY strokeWidthChanged FINAL)
37 Q_PROPERTY(QColor fillColor READ fillColor WRITE setFillColor NOTIFY fillColorChanged FINAL)
38 Q_PROPERTY(QColor strokeColor READ strokeColor WRITE setStrokeColor NOTIFY strokeColorChanged
39 FINAL)
40 Q_PROPERTY(QQuickShapePath::CapStyle capStyle READ capStyle WRITE setCapStyle NOTIFY
41 capStyleChanged FINAL)
42 Q_PROPERTY(QQuickShapePath::JoinStyle joinStyle READ joinStyle WRITE setJoinStyle NOTIFY
43 joinStyleChanged FINAL)
44 Q_PROPERTY(QQuickShapePath::StrokeStyle strokeStyle READ strokeStyle WRITE setStrokeStyle NOTIFY
45 strokeStyleChanged FINAL)
46 Q_PROPERTY(QList<qreal> dashPattern READ dashPattern WRITE setDashPattern NOTIFY
47 dashPatternChanged FINAL)
48 Q_PROPERTY(QQuickShapeGradient *fillGradient READ fillGradient WRITE setFillGradient NOTIFY
49 fillGradientChanged RESET resetFillGradient FINAL)
50 Q_PROPERTY(QQuickItem *fillItem READ fillItem WRITE setFillItem NOTIFY fillItemChanged FINAL REVISION(6, 12))
52 QML_NAMED_ELEMENT(StarShape)
53 QML_ADDED_IN_VERSION(6, 11)
54
55public:
56 QQuickStarShape(QQuickItem *parent = nullptr);
57 ~QQuickStarShape() override;
58
59 qreal dashOffset() const;
60 void setDashOffset(qreal);
61
62 qreal cornerRadius() const;
63 void setCornerRadius(qreal);
64
65 qreal ratio() const;
66 void setRatio(qreal);
67
68 int pointCount() const;
69 void setPointCount(int);
70
71 qreal strokeWidth() const;
72 void setStrokeWidth(qreal);
73
74 QColor fillColor() const;
75 void setFillColor(const QColor &color);
76
77 QColor strokeColor() const;
78 void setStrokeColor(const QColor &color);
79
80 QQuickShapePath::CapStyle capStyle() const;
81 void setCapStyle(QQuickShapePath::CapStyle style);
82
83 QQuickShapePath::JoinStyle joinStyle() const;
84 void setJoinStyle(QQuickShapePath::JoinStyle style);
85
86 QQuickShapePath::StrokeStyle strokeStyle() const;
87 void setStrokeStyle(QQuickShapePath::StrokeStyle style);
88
89 QList<qreal> dashPattern() const;
90 void setDashPattern(const QList<qreal> &array);
91
92 QQuickShapeGradient *fillGradient() const;
93 void setFillGradient(QQuickShapeGradient *fillGradient);
94 void resetFillGradient();
96 QQuickItem *fillItem() const;
97 void setFillItem(QQuickItem *newFillItem);
99Q_SIGNALS:
100 void cornerRadiusChanged();
101 void ratioChanged();
102 void pointCountChanged();
103 void strokeColorChanged();
104 void strokeWidthChanged();
105 void fillColorChanged();
106 void joinStyleChanged();
107 void capStyleChanged();
108 void strokeStyleChanged();
109 void dashOffsetChanged();
110 void dashPatternChanged();
111 void fillGradientChanged();
112 Q_REVISION(6, 12) void fillItemChanged();
113
114protected:
115 void itemChange(ItemChange change, const ItemChangeData &value) override;
116
117private:
118 Q_DISABLE_COPY(QQuickStarShape)
119 Q_DECLARE_PRIVATE(QQuickStarShape)
120};
121
122QT_END_NAMESPACE
123
124#endif // QQUICKSTARSHAPE_P_H
The QVector2D class represents a vector or vertex in 2D space.
Definition qvectornd.h:32
constexpr float y() const noexcept
Returns the y coordinate of this point.
Definition qvectornd.h:503
QVector2D normalized() const noexcept
Returns the normalized unit vector form of this vector.
Definition qvectornd.h:530
constexpr float x() const noexcept
Returns the x coordinate of this point.
Definition qvectornd.h:502
static constexpr float dotProduct(QVector2D v1, QVector2D v2) noexcept
Returns the dot product of v1 and v2.
Definition qvectornd.h:605