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
4#ifndef QQUICKSTARSHAPE_P_H
5#define QQUICKSTARSHAPE_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 QQuickStarShapePrivate;
24
25class Q_QUICKSHAPESDESIGNHELPERS_EXPORT QQuickStarShape : public QQuickShape
26{
27public:
28 Q_OBJECT
29 Q_PROPERTY(qreal dashOffset READ dashOffset WRITE setDashOffset NOTIFY dashOffsetChanged FINAL)
30 Q_PROPERTY(qreal cornerRadius READ cornerRadius WRITE setCornerRadius NOTIFY cornerRadiusChanged
31 FINAL)
32 Q_PROPERTY(int pointCount READ pointCount WRITE setPointCount NOTIFY pointCountChanged FINAL)
33 Q_PROPERTY(qreal ratio READ ratio WRITE setRatio NOTIFY ratioChanged FINAL)
34 Q_PROPERTY(
35 qreal strokeWidth READ strokeWidth WRITE setStrokeWidth NOTIFY strokeWidthChanged FINAL)
36 Q_PROPERTY(QColor fillColor READ fillColor WRITE setFillColor NOTIFY fillColorChanged FINAL)
37 Q_PROPERTY(QColor strokeColor READ strokeColor WRITE setStrokeColor NOTIFY strokeColorChanged
38 FINAL)
39 Q_PROPERTY(QQuickShapePath::CapStyle capStyle READ capStyle WRITE setCapStyle NOTIFY
40 capStyleChanged FINAL)
41 Q_PROPERTY(QQuickShapePath::JoinStyle joinStyle READ joinStyle WRITE setJoinStyle NOTIFY
42 joinStyleChanged FINAL)
43 Q_PROPERTY(QQuickShapePath::StrokeStyle strokeStyle READ strokeStyle WRITE setStrokeStyle NOTIFY
44 strokeStyleChanged FINAL)
45 Q_PROPERTY(QList<qreal> dashPattern READ dashPattern WRITE setDashPattern NOTIFY
46 dashPatternChanged FINAL)
47 Q_PROPERTY(QQuickShapeGradient *fillGradient READ fillGradient WRITE setFillGradient NOTIFY
48 gradientChanged RESET resetFillGradient FINAL)
50 QML_NAMED_ELEMENT(StarShape)
51 QML_ADDED_IN_VERSION(6, 11)
52
53public:
54 QQuickStarShape(QQuickItem *parent = nullptr);
55 ~QQuickStarShape() override;
56
57 qreal dashOffset() const;
58 void setDashOffset(qreal);
59
60 qreal cornerRadius() const;
61 void setCornerRadius(qreal);
62
63 qreal ratio() const;
64 void setRatio(qreal);
65
66 int pointCount() const;
67 void setPointCount(int);
68
69 qreal strokeWidth() const;
70 void setStrokeWidth(qreal);
71
72 QColor fillColor() const;
73 void setFillColor(const QColor &color);
74
75 QColor strokeColor() const;
76 void setStrokeColor(const QColor &color);
77
78 QQuickShapePath::CapStyle capStyle() const;
79 void setCapStyle(QQuickShapePath::CapStyle style);
80
81 QQuickShapePath::JoinStyle joinStyle() const;
82 void setJoinStyle(QQuickShapePath::JoinStyle style);
83
84 QQuickShapePath::StrokeStyle strokeStyle() const;
85 void setStrokeStyle(QQuickShapePath::StrokeStyle style);
86
87 QList<qreal> dashPattern() const;
88 void setDashPattern(const QList<qreal> &array);
90 QQuickShapeGradient *fillGradient() const;
91 void setFillGradient(QQuickShapeGradient *fillGradient);
92 void resetFillGradient();
94Q_SIGNALS:
95 void cornerRadiusChanged();
96 void ratioChanged();
97 void pointCountChanged();
98 void strokeColorChanged();
99 void strokeWidthChanged();
100 void fillColorChanged();
101 void joinStyleChanged();
102 void capStyleChanged();
103 void strokeStyleChanged();
104 void dashOffsetChanged();
105 void dashPatternChanged();
106 void gradientChanged();
107
108protected:
109 void itemChange(ItemChange change, const ItemChangeData &value) override;
110
111private:
112 Q_DISABLE_COPY(QQuickStarShape)
113 Q_DECLARE_PRIVATE(QQuickStarShape)
114};
115
116QT_END_NAMESPACE
117
118#endif // QQUICKSTARSHAPE_P_H
The QVector2D class represents a vector or vertex in 2D space.
Definition qvectornd.h:31
constexpr float y() const noexcept
Returns the y coordinate of this point.
Definition qvectornd.h:502
QVector2D normalized() const noexcept
Returns the normalized unit vector form of this vector.
Definition qvectornd.h:529
constexpr float x() const noexcept
Returns the x coordinate of this point.
Definition qvectornd.h:501
static constexpr float dotProduct(QVector2D v1, QVector2D v2) noexcept
Returns the dot product of v1 and v2.
Definition qvectornd.h:604