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