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
qquickregularpolygonshape_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 QQUICKREGULARPOLYGONSHAPE_P_H
6#define QQUICKREGULARPOLYGONSHAPE_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 QQuickRegularPolygonShapePrivate;
25
26class Q_QUICKSHAPESDESIGNHELPERS_EXPORT QQuickRegularPolygonShape : 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 FINAL)
32 Q_PROPERTY(int sideCount READ sideCount WRITE setSideCount NOTIFY sideCountChanged FINAL)
33 Q_PROPERTY(
34 qreal strokeWidth READ strokeWidth WRITE setStrokeWidth NOTIFY strokeWidthChanged FINAL)
35 Q_PROPERTY(QColor fillColor READ fillColor WRITE setFillColor NOTIFY fillColorChanged FINAL)
36 Q_PROPERTY(QColor strokeColor READ strokeColor WRITE setStrokeColor NOTIFY strokeColorChanged
37 FINAL)
38 Q_PROPERTY(QQuickShapePath::CapStyle capStyle READ capStyle WRITE setCapStyle NOTIFY
39 capStyleChanged FINAL)
40 Q_PROPERTY(QQuickShapePath::JoinStyle joinStyle READ joinStyle WRITE setJoinStyle NOTIFY
41 joinStyleChanged FINAL)
42 Q_PROPERTY(QQuickShapePath::StrokeStyle strokeStyle READ strokeStyle WRITE setStrokeStyle NOTIFY
43 strokeStyleChanged FINAL)
44 Q_PROPERTY(QList<qreal> dashPattern READ dashPattern WRITE setDashPattern NOTIFY
45 dashPatternChanged FINAL)
46 Q_PROPERTY(QQuickShapeGradient *fillGradient READ fillGradient WRITE setFillGradient NOTIFY
47 fillGradientChanged RESET resetFillGradient FINAL)
48 Q_PROPERTY(QQuickItem *fillItem READ fillItem WRITE setFillItem NOTIFY fillItemChanged FINAL REVISION(6, 12))
50 QML_NAMED_ELEMENT(RegularPolygonShape)
51 QML_ADDED_IN_VERSION(6, 11)
52
53public:
54 QQuickRegularPolygonShape(QQuickItem *parent = nullptr);
55 ~QQuickRegularPolygonShape() override;
56
57 qreal dashOffset() const;
58 void setDashOffset(qreal offset);
59
60 qreal cornerRadius() const;
61 void setCornerRadius(qreal);
62
63 int sideCount() const;
64 void setSideCount(int);
65
66 qreal strokeWidth() const;
67 void setStrokeWidth(qreal width);
68
69 QColor fillColor() const;
70 void setFillColor(const QColor &color);
71
72 QColor strokeColor() const;
73 void setStrokeColor(const QColor &color);
74
75 QQuickShapePath::CapStyle capStyle() const;
76 void setCapStyle(QQuickShapePath::CapStyle style);
77
78 QQuickShapePath::JoinStyle joinStyle() const;
79 void setJoinStyle(QQuickShapePath::JoinStyle style);
80
81 QQuickShapePath::StrokeStyle strokeStyle() const;
82 void setStrokeStyle(QQuickShapePath::StrokeStyle style);
83
84 QList<qreal> dashPattern() const;
85 void setDashPattern(const QList<qreal> &array);
86
87 QQuickShapeGradient *fillGradient() const;
88 void setFillGradient(QQuickShapeGradient *fillGradient);
89 void resetFillGradient();
91 QQuickItem *fillItem() const;
92 void setFillItem(QQuickItem *newFillItem);
94Q_SIGNALS:
95 void cornerRadiusChanged();
96 void sideCountChanged();
97 void strokeColorChanged();
98 void strokeWidthChanged();
99 void fillColorChanged();
100 void joinStyleChanged();
101 void capStyleChanged();
102 void strokeStyleChanged();
103 void dashOffsetChanged();
104 void dashPatternChanged();
105 void fillGradientChanged();
106 Q_REVISION(6, 12) void fillItemChanged();
107
108protected:
109 void itemChange(ItemChange change, const ItemChangeData &value) override;
110
111private:
112 Q_DISABLE_COPY(QQuickRegularPolygonShape)
113 Q_DECLARE_PRIVATE(QQuickRegularPolygonShape)
114};
115
116QT_END_NAMESPACE
117
118#endif // QQUICKREGULARPOLYGONSHAPE_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