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
qquickrectangleshape_p_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 QQUICKRECTANGLESHAPE_P_P_H
5#define QQUICKRECTANGLESHAPE_P_P_H
6
8
9#include <QtQml/private/qqmlpropertyutils_p.h>
10#include <QtQuickShapes/private/qquickshape_p_p.h>
11
12//
13// W A R N I N G
14// -------------
15//
16// This file is not part of the Qt API. It exists purely as an
17// implementation detail. This header file may change from version to
18// version without notice, or even be removed.
19//
20// We mean it.
21//
22
24
25class Q_QUICKSHAPESDESIGNHELPERS_EXPORT QQuickRectangleShapePrivate : public QQuickShapePrivate
26{
27 Q_DECLARE_PUBLIC(QQuickRectangleShape)
28
29public:
30 QQuickRectangleShapePrivate() = default;
31
32 static QQuickRectangleShapePrivate *get(QQuickRectangleShape *p) { return p->d_func(); }
33
34 void setTopLeftRadius(int topLeftRadius, QQml::PropertyUtils::State propertyState);
35 void setTopRightRadius(int topRightRadius, QQml::PropertyUtils::State propertyState);
36 void setBottomLeftRadius(int bottomLeftRadius, QQml::PropertyUtils::State propertyState);
37 void setBottomRightRadius(int bottomRightRadius, QQml::PropertyUtils::State propertyState);
38
39 void setTopLeftBevel(bool topLeftBevel, QQml::PropertyUtils::State propertyState);
40 void setTopRightBevel(bool topRightBevel, QQml::PropertyUtils::State propertyState);
41 void setBottomLeftBevel(bool bottomLeftBevel, QQml::PropertyUtils::State propertyState);
42 void setBottomRightBevel(bool bottomRightBevel, QQml::PropertyUtils::State propertyState);
43
44 void maybeUpdateElements();
45
46 void calculateIndependentRadii();
47
48 enum class Edge {
49 Top,
50 Right,
51 Bottom,
52 Left,
53 NEdges
54 };
55
56 QQuickShapePath *shapePath = nullptr;
57
58 QQuickPathLine *topPathLine = nullptr;
59 QQuickPathMove *topPathMove = nullptr;
60 QQuickPathArc *topRightPathArc = nullptr;
61 QQuickPathLine *rightPathLine = nullptr;
62 QQuickPathMove *rightPathMove = nullptr;
63 QQuickPathArc *bottomRightPathArc = nullptr;
64 QQuickPathLine *bottomPathLine = nullptr;
65 QQuickPathMove *bottomPathMove = nullptr;
66 QQuickPathArc *bottomLeftPathArc = nullptr;
67 QQuickPathLine *leftPathLine = nullptr;
68 QQuickPathArc *topLeftPathArc = nullptr;
69
70 static const int defaultRadius = 10;
71 static const bool defaultDrawEdge = true;
72 static const bool defaultBevel = false;
73
74 int radius = defaultRadius;
75 int topLeftRadius = defaultRadius;
76 int topRightRadius = defaultRadius;
77 int bottomLeftRadius = defaultRadius;
78 int bottomRightRadius = defaultRadius;
79 int effectiveTopLeftRadius = 0;
80 int effectiveTopRightRadius = 0;
81 int effectiveBottomLeftRadius = 0;
82 int effectiveBottomRightRadius = 0;
83 // If not set, the individual radii properties are equal to radius.
84 bool explicitTopLeftRadius = false;
85 bool explicitTopRightRadius = false;
86 bool explicitBottomLeftRadius = false;
87 bool explicitBottomRightRadius = false;
88 bool drawTop = defaultDrawEdge;
89 bool drawRight = defaultDrawEdge;
90 bool drawBottom = defaultDrawEdge;
91 bool drawLeft = defaultDrawEdge;
92 bool bevel = defaultBevel;
93 bool topLeftBevel = defaultBevel;
94 bool topRightBevel = defaultBevel;
95 bool bottomLeftBevel = defaultBevel;
96 bool bottomRightBevel = defaultBevel;
97 // If not set, the individual bevel properties are equal to bevel.
98 bool explicitTopLeftBevel = false;
99 bool explicitTopRightBevel = false;
100 bool explicitBottomLeftBevel = false;
101 bool explicitBottomRightBevel = false;
102 qreal borderOffset = 0;
103 qreal borderRadiusAdjustment = 0;
104 Edge firstVisibleEdge = Edge::NEdges;
105 QQuickRectangleShape::BorderMode borderMode = QQuickRectangleShape::BorderMode::Inside;
106
107};
108
109QT_END_NAMESPACE
110
111#endif // QQUICKRECTANGLESHAPE_P_P_H
T * createElement(QQuickShapePath *shapePath, const char *objectName)