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