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.cpp
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
7
9
10/*!
11 \class QQuickRectangleShape
12 \inmodule QtQuickShapes
13 \internal
14*/
15
16Q_STATIC_LOGGING_CATEGORY(lcCalculateIndependentRadii, "qt.quick.shapes.designhelpers.rectangleshape.calculateindependentradii")
17Q_STATIC_LOGGING_CATEGORY(lcUpdatePolish, "qt.quick.shapes.designhelpers.rectangleshape.updatepolish")
18Q_STATIC_LOGGING_CATEGORY(lcMaybeUpdateElements, "qt.quick.shapes.designhelpers.rectangleshape.maybeupdateelements")
19
20void QQuickRectangleShapePrivate::setTopLeftRadius(int topLeftRadius,
21 QQml::PropertyUtils::State propertyState)
22{
23 Q_Q(QQuickRectangleShape);
24 const int oldEffectiveTopLeftRadius = q->topLeftRadius();
25 explicitTopLeftRadius = isExplicitlySet(propertyState);
26 this->topLeftRadius = topLeftRadius;
27
28 if (q->topLeftRadius() == oldEffectiveTopLeftRadius)
29 return;
30
31 q->polish();
32 emit q->topLeftRadiusChanged();
33}
34
35void QQuickRectangleShapePrivate::setTopRightRadius(int topRightRadius,
36 QQml::PropertyUtils::State propertyState)
37{
38 Q_Q(QQuickRectangleShape);
39 const int oldEffectiveTopRightRadius = q->topRightRadius();
40 explicitTopRightRadius = isExplicitlySet(propertyState);
41 this->topRightRadius = topRightRadius;
42
43 if (q->topRightRadius() == oldEffectiveTopRightRadius)
44 return;
45
46 q->polish();
47 emit q->topRightRadiusChanged();
48}
49
50void QQuickRectangleShapePrivate::setBottomLeftRadius(int bottomLeftRadius,
51 QQml::PropertyUtils::State propertyState)
52{
53 Q_Q(QQuickRectangleShape);
54 const int oldEffectiveBottomLeftRadius = q->bottomLeftRadius();
55 explicitBottomLeftRadius = isExplicitlySet(propertyState);
56 this->bottomLeftRadius = bottomLeftRadius;
57
58 if (q->bottomLeftRadius() == oldEffectiveBottomLeftRadius)
59 return;
60
61 q->polish();
62 emit q->bottomLeftRadiusChanged();
63}
64
65void QQuickRectangleShapePrivate::setBottomRightRadius(int bottomRightRadius,
66 QQml::PropertyUtils::State propertyState)
67{
68 Q_Q(QQuickRectangleShape);
69 const int oldEffectiveBottomRightRadius = q->bottomRightRadius();
70 explicitBottomRightRadius = isExplicitlySet(propertyState);
71 this->bottomRightRadius = bottomRightRadius;
72
73 if (q->bottomRightRadius() == oldEffectiveBottomRightRadius)
74 return;
75
76 q->polish();
77 emit q->bottomRightRadiusChanged();
78}
79
80void QQuickRectangleShapePrivate::setTopLeftBevel(bool topLeftBevel,
81 QQml::PropertyUtils::State propertyState)
82{
83 Q_Q(QQuickRectangleShape);
84 const bool oldTopLeftBevel = q->hasTopLeftBevel();
85 explicitTopLeftBevel = isExplicitlySet(propertyState);
86 this->topLeftBevel = topLeftBevel;
87
88 if (q->hasTopLeftBevel() == oldTopLeftBevel)
89 return;
90
91 q->polish();
92 emit q->topLeftBevelChanged();
93}
94
95void QQuickRectangleShapePrivate::setTopRightBevel(bool topRightBevel,
96 QQml::PropertyUtils::State propertyState)
97{
98 Q_Q(QQuickRectangleShape);
99 const bool oldTopRightBevel = q->hasTopRightBevel();
100 explicitTopRightBevel = isExplicitlySet(propertyState);
101 this->topRightBevel = topRightBevel;
102
103 if (q->hasTopRightBevel() == oldTopRightBevel)
104 return;
105
106 q->polish();
107 emit q->topRightBevelChanged();
108}
109
110void QQuickRectangleShapePrivate::setBottomLeftBevel(bool bottomLeftBevel,
111 QQml::PropertyUtils::State propertyState)
112{
113 Q_Q(QQuickRectangleShape);
114 const bool oldBottomLeftBevel = q->hasBottomLeftBevel();
115 explicitBottomLeftBevel = isExplicitlySet(propertyState);
116 this->bottomLeftBevel = bottomLeftBevel;
117
118 if (q->hasBottomLeftBevel() == oldBottomLeftBevel)
119 return;
120
121 q->polish();
122 emit q->bottomLeftBevelChanged();
123}
124
125void QQuickRectangleShapePrivate::setBottomRightBevel(bool bottomRightBevel,
126 QQml::PropertyUtils::State propertyState)
127{
128 Q_Q(QQuickRectangleShape);
129 const bool oldBottomRightBevel = q->hasBottomRightBevel();
130 explicitBottomRightBevel = isExplicitlySet(propertyState);
131 this->bottomRightBevel = bottomRightBevel;
132
133 if (q->hasBottomRightBevel() == oldBottomRightBevel)
134 return;
135
136 q->polish();
137 emit q->bottomRightBevelChanged();
138}
139
140template <typename T>
141T *createElement(QQuickShapePath *shapePath, const char *objectName)
142{
143 auto *element = new T(shapePath);
144 element->setObjectName(objectName);
145 return element;
146}
147
148/*!
149 \internal
150
151 Constructs and append the individual path elements to the ShapePath.
152*/
153void QQuickRectangleShapePrivate::maybeUpdateElements()
154{
155 if (!componentComplete)
156 return;
157
158 auto *shapePathPrivate = QQuickShapePathPrivate::get(shapePath);
159
160 // We need to delete the elements since we create them ourselves.
161 qCDebug(lcMaybeUpdateElements).nospace() << "maybeUpdateElements called on "
162 // Avoid printing the QQuickItem as it results in assertion failure in QQuickItemLayer::componentComplete.
163 << static_cast<void *>(q_func()) << "; deleting and clearing path elements";
164 shapePathPrivate->clearPathElements(QQuickPathPrivate::DeleteElementPolicy::Delete);
165
166 static const QQuickPathPrivate::ProcessPathPolicy DontProcessPath
167 = QQuickPathPrivate::ProcessPathPolicy::DontProcess;
168
169 // We avoid rendering issues (QDS-14861) by rotating the start position
170 // clockwise until the first visible edge after a hidden edge was found.
171 // Set the start position (startIndex) to that edge and continue the construction of
172 // the border item from there.
173 const std::array visibleEdges = {drawTop, drawRight, drawBottom, drawLeft };
174 int startIndex = 0;
175 for (int currentEdge = static_cast<int>(Edge::Top); currentEdge < static_cast<int>(Edge::NEdges); ++currentEdge) {
176 const int previousEdge = (currentEdge + 3) % 4;
177 if (!visibleEdges[previousEdge] && visibleEdges[currentEdge]) {
178 startIndex = currentEdge;
179 break;
180 }
181 }
182
183 firstVisibleEdge = static_cast<Edge>(startIndex);
184 qCDebug(lcMaybeUpdateElements) << "firstVisibleEdge:" << startIndex; // (Can't print the enum itself)
185
186 for (int i = 0; i < 4; i++) {
187 const int currentEdge = (startIndex + i) % 4;
188 const int nextEdge = (startIndex + i + 1) % 4;
189
190 switch (static_cast<Edge>(currentEdge)) {
191 case Edge::Top:
192 if (visibleEdges[currentEdge]) {
193 topPathLine = createElement<QQuickPathLine>(shapePath, "topPathLine");
194 shapePathPrivate->appendPathElement(topPathLine, DontProcessPath);
195 topPathMove = nullptr;
196 } else {
197 topPathLine = nullptr;
198 topPathMove = createElement<QQuickPathMove>(shapePath, "topPathMove");
199 shapePathPrivate->appendPathElement(topPathMove, DontProcessPath);
200 }
201
202 // Top right corner
203 if (visibleEdges[currentEdge] && visibleEdges[nextEdge]) {
204 topRightPathArc = createElement<QQuickPathArc>(shapePath, "topRightPathArc");
205 shapePathPrivate->appendPathElement(topRightPathArc, DontProcessPath);
206 } else {
207 topRightPathArc = nullptr;
208 }
209 break;
210 case Edge::Right:
211 if (visibleEdges[currentEdge]) {
212 rightPathLine = createElement<QQuickPathLine>(shapePath, "rightPathLine");
213 shapePathPrivate->appendPathElement(rightPathLine, DontProcessPath);
214 rightPathMove = nullptr;
215 } else {
216 rightPathLine = nullptr;
217 rightPathMove = createElement<QQuickPathMove>(shapePath, "rightPathMove");
218 shapePathPrivate->appendPathElement(rightPathMove, DontProcessPath);
219 }
220
221 // Bottom right corner
222 if (visibleEdges[currentEdge] && visibleEdges[nextEdge]) {
223 bottomRightPathArc = createElement<QQuickPathArc>(shapePath, "bottomRightPathArc");
224 shapePathPrivate->appendPathElement(bottomRightPathArc, DontProcessPath);
225 } else {
226 bottomRightPathArc = nullptr;
227 }
228 break;
229 case Edge::Bottom:
230 if (visibleEdges[currentEdge]) {
231 bottomPathLine = createElement<QQuickPathLine>(shapePath, "bottomPathLine");
232 shapePathPrivate->appendPathElement(bottomPathLine, DontProcessPath);
233 bottomPathMove = nullptr;
234 } else {
235 bottomPathLine = nullptr;
236 bottomPathMove = createElement<QQuickPathMove>(shapePath, "bottomPathMove");
237 shapePathPrivate->appendPathElement(bottomPathMove, DontProcessPath);
238 }
239
240 // Bottom left corner
241 if (visibleEdges[currentEdge] && visibleEdges[nextEdge]) {
242 bottomLeftPathArc = createElement<QQuickPathArc>(shapePath, "bottomLeftPathArc");
243 shapePathPrivate->appendPathElement(bottomLeftPathArc, DontProcessPath);
244 } else {
245 bottomLeftPathArc = nullptr;
246 }
247 break;
248 case Edge::Left:
249 if (visibleEdges[currentEdge]) {
250 leftPathLine = createElement<QQuickPathLine>(shapePath, "leftPathLine");
251 shapePathPrivate->appendPathElement(leftPathLine, DontProcessPath);
252 } else {
253 leftPathLine = nullptr;
254 // There isn't a leftPathMove because it will only be applicable for the case where
255 // there is only a top and bottom edge (the only configuration where a
256 // left-path-move could be needed), and if that is the case, it must start with the
257 // top edge, and must end at the left edge, so there is never need to move the path
258 // at the last (left in this case) edge.
259 }
260
261 // Top left corner
262 if (visibleEdges[currentEdge] && visibleEdges[nextEdge]) {
263 topLeftPathArc = createElement<QQuickPathArc>(shapePath, "topLeftPathArc");
264 shapePathPrivate->appendPathElement(topLeftPathArc, DontProcessPath);
265 } else {
266 topLeftPathArc = nullptr;
267 }
268 break;
269 case Edge::NEdges:
270 Q_UNREACHABLE();
271 }
272 }
273
274 qCDebug(lcMaybeUpdateElements) << "about to process path";
275 shapePath->processPath();
276 qCDebug(lcMaybeUpdateElements) << "about to call _q_shapePathChanged (i.e. polish and update implicit size)";
277 _q_shapePathChanged();
278}
279
280void QQuickRectangleShapePrivate::calculateIndependentRadii()
281{
282 Q_Q(const QQuickRectangleShape);
283 const qreal rectWidth = width.valueBypassingBindings();
284 const qreal rectHeight = height.valueBypassingBindings();
285 const int minDimension = qMin(rectWidth, rectHeight);
286 const int maxRadius = minDimension / 2;
287 const int topLeftRadius = q->topLeftRadius();
288 const int topRightRadius = q->topRightRadius();
289 const int bottomRightRadius = q->bottomRightRadius();
290 const int bottomLeftRadius = q->bottomLeftRadius();
291 const bool mixed = !(radius == topLeftRadius
292 && radius == topRightRadius
293 && radius == bottomLeftRadius
294 && radius == bottomRightRadius);
295
296 // Uniform radii
297 if (!mixed) {
298 effectiveTopLeftRadius = qMin(topLeftRadius, maxRadius);
299 effectiveTopRightRadius = qMin(topRightRadius, maxRadius);
300 effectiveBottomRightRadius = qMin(bottomRightRadius, maxRadius);
301 effectiveBottomLeftRadius = qMin(bottomLeftRadius, maxRadius);
302 qCDebug(lcCalculateIndependentRadii) << "calculateIndependentRadii: using uniform radii of" << radius
303 << "width" << rectWidth
304 << "height" << rectHeight
305 << "minDimension" << minDimension
306 << "tlr" << topLeftRadius
307 << "etlr" << effectiveTopLeftRadius
308 << "trr" << topRightRadius
309 << "etrr" << effectiveTopRightRadius
310 << "blr" << bottomLeftRadius
311 << "eblr" << effectiveBottomLeftRadius
312 << "brr" << bottomRightRadius
313 << "ebrr" << effectiveBottomRightRadius;
314 return;
315 }
316
317 // Mixed radii
318 qreal topLeftRadiusMin = qMin(minDimension, topLeftRadius);
319 qreal topRightRadiusMin = qMin(minDimension, topRightRadius);
320 qreal bottomLeftRadiusMin = qMin(minDimension, bottomLeftRadius);
321 qreal bottomRightRadiusMin = qMin(minDimension, bottomRightRadius);
322
323 // Top radii
324 const qreal topRadii = topLeftRadius + topRightRadius;
325
326 if (topRadii > rectWidth) {
327 const qreal topLeftRadiusFactor = topLeftRadius / topRadii;
328 const qreal tlr = qRound(rectWidth * topLeftRadiusFactor);
329
330 topLeftRadiusMin = qMin(topLeftRadiusMin, tlr);
331 topRightRadiusMin = qMin(topRightRadiusMin, rectWidth - tlr);
332 }
333
334 // Right radii
335 const qreal rightRadii = topRightRadius + bottomRightRadius;
336
337 if (rightRadii > rectHeight) {
338 const qreal topRightRadiusFactor = topRightRadius / rightRadii;
339 const qreal trr = qRound(rectHeight * topRightRadiusFactor);
340
341 topRightRadiusMin = qMin(topRightRadiusMin, trr);
342 bottomRightRadiusMin = qMin(bottomRightRadiusMin, rectHeight - trr);
343 }
344
345 // Bottom radii
346 const qreal bottomRadii = bottomRightRadius + bottomLeftRadius;
347
348 if (bottomRadii > rectWidth) {
349 const qreal bottomRightRadiusFactor = bottomRightRadius / bottomRadii;
350 const qreal brr = qRound(rectWidth * bottomRightRadiusFactor);
351
352 bottomRightRadiusMin = qMin(bottomRightRadiusMin, brr);
353 bottomLeftRadiusMin = qMin(bottomLeftRadiusMin, rectWidth - brr);
354 }
355
356 // Left radii
357 const qreal leftRadii = bottomLeftRadius + topLeftRadius;
358
359 if (leftRadii > rectHeight) {
360 const qreal bottomLeftRadiusFactor = bottomLeftRadius / leftRadii;
361 const qreal blr = qRound(rectHeight * bottomLeftRadiusFactor);
362
363 bottomLeftRadiusMin = qMin(bottomLeftRadiusMin, blr);
364 topLeftRadiusMin = qMin(topLeftRadiusMin, rectHeight - blr);
365 }
366
367 effectiveTopLeftRadius = topLeftRadiusMin;
368 effectiveTopRightRadius = topRightRadiusMin;
369 effectiveBottomLeftRadius = bottomLeftRadiusMin;
370 effectiveBottomRightRadius = bottomRightRadiusMin;
371
372 qCDebug(lcCalculateIndependentRadii) << "calculateIndependentRadii:"
373 << "width" << rectWidth
374 << "height" << rectHeight
375 << "borderMode" << borderMode
376 << "strokeWidth" << shapePath->strokeWidth()
377 << "minDimension" << minDimension
378 << "tlr" << topLeftRadius
379 << "etlr" << effectiveTopLeftRadius
380 << "trr" << topRightRadius
381 << "etrr" << effectiveTopRightRadius
382 << "blr" << bottomLeftRadius
383 << "eblr" << effectiveBottomLeftRadius
384 << "brr" << bottomRightRadius
385 << "ebrr" << effectiveBottomRightRadius
386 << "borderOffset" << borderOffset
387 << "startX" << shapePath->startX()
388 << "startY" << shapePath->startY();
389}
390
391/*!
392 \qmltype RectangleShape
393 \inqmlmodule QtQuick.Shapes.DesignHelpers
394 \brief A filled rectangle with an optional border.
395 \since QtQuick 6.10
396
397 RectangleShape is used to fill areas with solid color or gradients and to
398 provide a rectangular border.
399
400 Each Rectangle item is painted using either a solid fill color, specified
401 using the \l fillColor property, or a gradient, defined using one of the \l
402 ShapeGradient subtypes and set using the \l gradient property. If both a
403 color and a gradient are specified, the gradient is used.
404
405 An optional border can be added to a rectangle with its own color and
406 thickness by setting the \l strokeColor and \l strokeWidth properties.
407 Setting the color to \c transparent creates a border without a fill color.
408
409 Rounded rectangles can be drawn using the \l radius property. The radius
410 can also be specified separately for each corner. Additionally, \l bevel
411 can be applied on any corner to cut it off sharply.
412
413 RectangleShape's default value for \l {QtQuick.Shapes::Shape::preferredRendererType} is
414 \c Shape.CurveRenderer.
415
416 \section1 Example Usage
417
418 \snippet rectangleshape-bevel.qml rectangleShape
419
420 \image pathrectangle-bevel.png
421*/
422
423QQuickRectangleShape::QQuickRectangleShape(QQuickItem *parent)
424 : QQuickShape(*(new QQuickRectangleShapePrivate), parent)
425{
426 Q_D(QQuickRectangleShape);
427
428 // Create the ShapePath.
429 d->shapePath = new QQuickShapePath(this);
430 d->shapePath->setObjectName("rectangleShapeShapePath");
431 d->shapePath->setStrokeWidth(1);
432 d->shapePath->setStrokeColor(QColorConstants::Black);
433 d->shapePath->setFillColor(QColorConstants::White);
434 d->shapePath->setJoinStyle(QQuickShapePath::BevelJoin);
435 // Don't make it asynchronous, as it results in brief periods of incorrect rendering.
436
437 connect(d->shapePath, &QQuickShapePath::strokeColorChanged, this, &QQuickRectangleShape::strokeColorChanged);
438 connect(d->shapePath, &QQuickShapePath::strokeWidthChanged, this, &QQuickRectangleShape::strokeWidthChanged);
439 connect(d->shapePath, &QQuickShapePath::fillColorChanged, this, &QQuickRectangleShape::fillColorChanged);
440 connect(d->shapePath, &QQuickShapePath::joinStyleChanged, this, &QQuickRectangleShape::joinStyleChanged);
441 connect(d->shapePath, &QQuickShapePath::capStyleChanged, this, &QQuickRectangleShape::capStyleChanged);
442 connect(d->shapePath, &QQuickShapePath::strokeStyleChanged, this, &QQuickRectangleShape::strokeStyleChanged);
443 connect(d->shapePath, &QQuickShapePath::dashOffsetChanged, this, &QQuickRectangleShape::dashOffsetChanged);
444 connect(d->shapePath, &QQuickShapePath::dashPatternChanged, this, &QQuickRectangleShape::dashPatternChanged);
445 connect(d->shapePath, &QQuickShapePath::fillItemChanged, this, &QQuickRectangleShape::fillItemChanged);
446 connect(d->shapePath, &QQuickShapePath::fillGradientChanged, this, &QQuickRectangleShape::fillGradientChanged);
447
448 // Add the path as a child of us.
449 // The individual path elements will be added to the shape path in maybeUpdateElements().
450 // Do what vpe_append in qquickshape.cpp does except without the overhead of the QQmlListProperty stuff.
451 d->sp.append(d->shapePath);
452 // Similar, but for QQuickItemPrivate::data_append...
453 d->shapePath->setParent(this);
454 // ... which calls QQuickItemPrivate::resources_append.
455 d->extra.value().resourcesList.append(d->shapePath);
456
457 setWidth(200);
458 setHeight(200);
459 setPreferredRendererType(CurveRenderer);
460
461 // QQuickShape::componentComplete sets up the connections to each path.
462 // It also calls _q_shapePathChanged, which will call polish (for our updatePolish).
463}
464
465QQuickRectangleShape::~QQuickRectangleShape()
466{
467}
468
469/*!
470 \since 6.11
471 \qmlproperty bool QtQuick.Shapes.DesignHelpers::RectangleShape::drawTop
472
473 This property holds whether the top border is drawn.
474
475 The default value is \c true.
476*/
477bool QQuickRectangleShape::drawTop() const
478{
479 Q_D(const QQuickRectangleShape);
480 return d->drawTop;
481}
482
483void QQuickRectangleShape::setDrawTop(bool drawTop)
484{
485 Q_D(QQuickRectangleShape);
486 if (drawTop == d->drawTop)
487 return;
488
489 d->drawTop = drawTop;
490 d->maybeUpdateElements();
491 emit drawTopChanged();
492}
493
494void QQuickRectangleShape::resetDrawTop()
495{
496 setDrawTop(QQuickRectangleShapePrivate::defaultDrawEdge);
497}
498
499/*!
500 \since 6.11
501 \qmlproperty bool QtQuick.Shapes.DesignHelpers::RectangleShape::drawRight
502
503 This property holds whether the right border is drawn.
504
505 The default value is \c true.
506*/
507bool QQuickRectangleShape::drawRight() const
508{
509 Q_D(const QQuickRectangleShape);
510 return d->drawRight;
511}
512
513void QQuickRectangleShape::setDrawRight(bool drawRight)
514{
515 Q_D(QQuickRectangleShape);
516 if (drawRight == d->drawRight)
517 return;
518
519 d->drawRight = drawRight;
520 d->maybeUpdateElements();
521 emit drawRightChanged();
522}
523
524void QQuickRectangleShape::resetDrawRight()
525{
526 setDrawRight(QQuickRectangleShapePrivate::defaultDrawEdge);
527}
528
529/*!
530 \since 6.11
531 \qmlproperty bool QtQuick.Shapes.DesignHelpers::RectangleShape::drawBottom
532
533 This property holds whether the bottom border is drawn.
534
535 The default value is \c true.
536*/
537bool QQuickRectangleShape::drawBottom() const
538{
539 Q_D(const QQuickRectangleShape);
540 return d->drawBottom;
541}
542
543void QQuickRectangleShape::setDrawBottom(bool drawBottom)
544{
545 Q_D(QQuickRectangleShape);
546 if (drawBottom == d->drawBottom)
547 return;
548
549 d->drawBottom = drawBottom;
550 d->maybeUpdateElements();
551 emit drawBottomChanged();
552}
553
554void QQuickRectangleShape::resetDrawBottom()
555{
556 setDrawBottom(QQuickRectangleShapePrivate::defaultDrawEdge);
557}
558
559/*!
560 \since 6.11
561 \qmlproperty bool QtQuick.Shapes.DesignHelpers::RectangleShape::drawLeft
562
563 This property holds whether the left border is drawn.
564
565 The default value is \c true.
566*/
567bool QQuickRectangleShape::drawLeft() const
568{
569 Q_D(const QQuickRectangleShape);
570 return d->drawLeft;
571}
572
573void QQuickRectangleShape::setDrawLeft(bool drawLeft)
574{
575 Q_D(QQuickRectangleShape);
576 if (drawLeft == d->drawLeft)
577 return;
578
579 d->drawLeft = drawLeft;
580 d->maybeUpdateElements();
581 emit drawLeftChanged();
582}
583
584void QQuickRectangleShape::resetDrawLeft()
585{
586 setDrawLeft(QQuickRectangleShapePrivate::defaultDrawEdge);
587}
588
589/*!
590 \include pathrectangle.qdocinc {radius-property}
591 {QtQuick.Shapes.DesignHelpers::RectangleShape}
592
593 The default value is \c 10.
594*/
595
596int QQuickRectangleShape::radius() const
597{
598 Q_D(const QQuickRectangleShape);
599 return d->radius;
600}
601
602void QQuickRectangleShape::setRadius(int radius)
603{
604 Q_D(QQuickRectangleShape);
605 if (radius == d->radius)
606 return;
607
608 const int oldTopLeftRadius = topLeftRadius();
609 const int oldTopRightRadius = topRightRadius();
610 const int oldBottomRightRadius = bottomRightRadius();
611 const int oldBottomLeftRadius = bottomLeftRadius();
612
613 d->radius = radius;
614 polish();
615 emit radiusChanged();
616 if (topLeftRadius() != oldTopLeftRadius)
617 emit topLeftRadiusChanged();
618 if (topRightRadius() != oldTopRightRadius)
619 emit topRightRadiusChanged();
620 if (bottomRightRadius() != oldBottomRightRadius)
621 emit bottomRightRadiusChanged();
622 if (bottomLeftRadius() != oldBottomLeftRadius)
623 emit bottomLeftRadiusChanged();
624}
625
626void QQuickRectangleShape::resetRadius()
627{
628 setRadius(QQuickRectangleShapePrivate::defaultRadius);
629}
630
631/*!
632 \include pathrectangle.qdocinc {radius-properties}
633 {QtQuick.Shapes.DesignHelpers::RectangleShape} {rectangleshape.qml} {rectangleShape}
634*/
635
636int QQuickRectangleShape::topLeftRadius() const
637{
638 Q_D(const QQuickRectangleShape);
639 return d->explicitTopLeftRadius ? d->topLeftRadius : d->radius;
640}
641
642void QQuickRectangleShape::setTopLeftRadius(int topLeftRadius)
643{
644 Q_D(QQuickRectangleShape);
645 d->setTopLeftRadius(topLeftRadius, QQml::PropertyUtils::State::ExplicitlySet);
646}
647
648void QQuickRectangleShape::resetTopLeftRadius()
649{
650 Q_D(QQuickRectangleShape);
651 d->setTopLeftRadius(QQuickRectangleShapePrivate::defaultRadius,
652 QQml::PropertyUtils::State::ImplicitlySet);
653}
654
655int QQuickRectangleShape::topRightRadius() const
656{
657 Q_D(const QQuickRectangleShape);
658 return d->explicitTopRightRadius ? d->topRightRadius : d->radius;
659}
660
661void QQuickRectangleShape::setTopRightRadius(int topRightRadius)
662{
663 Q_D(QQuickRectangleShape);
664 d->setTopRightRadius(topRightRadius, QQml::PropertyUtils::State::ExplicitlySet);
665}
666
667void QQuickRectangleShape::resetTopRightRadius()
668{
669 Q_D(QQuickRectangleShape);
670 d->setTopRightRadius(QQuickRectangleShapePrivate::defaultRadius,
671 QQml::PropertyUtils::State::ImplicitlySet);
672}
673
674int QQuickRectangleShape::bottomLeftRadius() const
675{
676 Q_D(const QQuickRectangleShape);
677 return d->explicitBottomLeftRadius ? d->bottomLeftRadius : d->radius;
678}
679
680void QQuickRectangleShape::setBottomLeftRadius(int bottomLeftRadius)
681{
682 Q_D(QQuickRectangleShape);
683 d->setBottomLeftRadius(bottomLeftRadius, QQml::PropertyUtils::State::ExplicitlySet);
684}
685
686void QQuickRectangleShape::resetBottomLeftRadius()
687{
688 Q_D(QQuickRectangleShape);
689 d->setBottomLeftRadius(QQuickRectangleShapePrivate::defaultRadius,
690 QQml::PropertyUtils::State::ImplicitlySet);
691}
692
693int QQuickRectangleShape::bottomRightRadius() const
694{
695 Q_D(const QQuickRectangleShape);
696 return d->explicitBottomRightRadius ? d->bottomRightRadius : d->radius;
697}
698
699void QQuickRectangleShape::setBottomRightRadius(int bottomRightRadius)
700{
701 Q_D(QQuickRectangleShape);
702 d->setBottomRightRadius(bottomRightRadius, QQml::PropertyUtils::State::ExplicitlySet);
703}
704
705void QQuickRectangleShape::resetBottomRightRadius()
706{
707 Q_D(QQuickRectangleShape);
708 d->setBottomRightRadius(QQuickRectangleShapePrivate::defaultRadius,
709 QQml::PropertyUtils::State::ImplicitlySet);
710}
711
712/*!
713 \include pathrectangle.qdocinc {bevel-property}
714 {QtQuick.Shapes.DesignHelpers::RectangleShape}
715 {rectangleshape-bevel.qml}{rectangleShape}
716*/
717
718bool QQuickRectangleShape::hasBevel() const
719{
720 Q_D(const QQuickRectangleShape);
721 return d->bevel;
722}
723
724void QQuickRectangleShape::setBevel(bool bevel)
725{
726 Q_D(QQuickRectangleShape);
727 if (bevel == d->bevel)
728 return;
729
730 const bool oldTopLeftBevel = hasTopLeftBevel();
731 const bool oldTopRightBevel = hasTopRightBevel();
732 const bool oldBottomRightBevel = hasBottomRightBevel();
733 const bool oldBottomLeftBevel = hasBottomLeftBevel();
734
735 d->bevel = bevel;
736 polish();
737 emit bevelChanged();
738 if (hasTopLeftBevel() != oldTopLeftBevel)
739 emit topLeftBevelChanged();
740 if (hasTopRightBevel() != oldTopRightBevel)
741 emit topRightBevelChanged();
742 if (hasBottomRightBevel() != oldBottomRightBevel)
743 emit bottomRightBevelChanged();
744 if (hasBottomLeftBevel() != oldBottomLeftBevel)
745 emit bottomLeftBevelChanged();
746}
747
748void QQuickRectangleShape::resetBevel()
749{
750 setBevel(false);
751}
752
753/*!
754 \include pathrectangle.qdocinc {bevel-properties}
755 {QtQuick.Shapes.DesignHelpers::RectangleShape}
756 {rectangleshape.qml} {rectangleShape}
757*/
758
759bool QQuickRectangleShape::hasTopLeftBevel() const
760{
761 Q_D(const QQuickRectangleShape);
762 return d->explicitTopLeftBevel ? d->topLeftBevel : d->bevel;
763}
764
765void QQuickRectangleShape::setTopLeftBevel(bool topLeftBevel)
766{
767 Q_D(QQuickRectangleShape);
768 d->setTopLeftBevel(topLeftBevel, QQml::PropertyUtils::State::ExplicitlySet);
769}
770
771void QQuickRectangleShape::resetTopLeftBevel()
772{
773 Q_D(QQuickRectangleShape);
774 d->setTopLeftBevel(QQuickRectangleShapePrivate::defaultBevel,
775 QQml::PropertyUtils::State::ImplicitlySet);
776}
777
778bool QQuickRectangleShape::hasTopRightBevel() const
779{
780 Q_D(const QQuickRectangleShape);
781 return d->explicitTopRightBevel ? d->topRightBevel : d->bevel;
782}
783
784void QQuickRectangleShape::setTopRightBevel(bool topRightBevel)
785{
786 Q_D(QQuickRectangleShape);
787 d->setTopRightBevel(topRightBevel, QQml::PropertyUtils::State::ExplicitlySet);
788}
789
790void QQuickRectangleShape::resetTopRightBevel()
791{
792 Q_D(QQuickRectangleShape);
793 d->setTopRightBevel(QQuickRectangleShapePrivate::defaultBevel,
794 QQml::PropertyUtils::State::ImplicitlySet);
795}
796
797bool QQuickRectangleShape::hasBottomLeftBevel() const
798{
799 Q_D(const QQuickRectangleShape);
800 return d->explicitBottomLeftBevel ? d->bottomLeftBevel : d->bevel;
801}
802
803void QQuickRectangleShape::setBottomLeftBevel(bool bottomLeftBevel)
804{
805 Q_D(QQuickRectangleShape);
806 d->setBottomLeftBevel(bottomLeftBevel, QQml::PropertyUtils::State::ExplicitlySet);
807}
808
809void QQuickRectangleShape::resetBottomLeftBevel()
810{
811 Q_D(QQuickRectangleShape);
812 d->setBottomLeftBevel(QQuickRectangleShapePrivate::defaultBevel,
813 QQml::PropertyUtils::State::ImplicitlySet);
814}
815
816bool QQuickRectangleShape::hasBottomRightBevel() const
817{
818 Q_D(const QQuickRectangleShape);
819 return d->explicitBottomRightBevel ? d->bottomRightBevel : d->bevel;
820}
821
822void QQuickRectangleShape::setBottomRightBevel(bool bottomRightBevel)
823{
824 Q_D(QQuickRectangleShape);
825 d->setBottomRightBevel(bottomRightBevel, QQml::PropertyUtils::State::ExplicitlySet);
826}
827
828void QQuickRectangleShape::resetBottomRightBevel()
829{
830 Q_D(QQuickRectangleShape);
831 d->setBottomRightBevel(QQuickRectangleShapePrivate::defaultBevel,
832 QQml::PropertyUtils::State::ImplicitlySet);
833}
834
835/*!
836 \qmlproperty color QtQuick.Shapes.DesignHelpers::RectangleShape::strokeColor
837
838 This property holds the stroking color.
839
840 When set to \c transparent, no stroking occurs.
841
842 The default value is \c "black".
843*/
844
845QColor QQuickRectangleShape::strokeColor() const
846{
847 Q_D(const QQuickRectangleShape);
848 return d->shapePath->strokeColor();
849}
850
851void QQuickRectangleShape::setStrokeColor(const QColor &color)
852{
853 Q_D(QQuickRectangleShape);
854 d->shapePath->setStrokeColor(color);
855}
856
857/*!
858 \qmlproperty real QtQuick.Shapes.DesignHelpers::RectangleShape::strokeWidth
859
860 This property holds the stroke width.
861
862 When set to a negative value, no stroking occurs.
863
864 The default value is \c 1.
865*/
866
867qreal QQuickRectangleShape::strokeWidth() const
868{
869 Q_D(const QQuickRectangleShape);
870 return d->shapePath->strokeWidth();
871}
872
873void QQuickRectangleShape::setStrokeWidth(qreal width)
874{
875 Q_D(QQuickRectangleShape);
876 d->shapePath->setStrokeWidth(width);
877}
878
879/*!
880 \qmlproperty color QtQuick.Shapes.DesignHelpers::RectangleShape::fillColor
881
882 This property holds the fill color.
883
884 When set to \c transparent, no filling occurs.
885
886 The default value is \c "white".
887
888 \note If either \l fillGradient is set to something other than \c null, it
889 will be used instead of \c fillColor.
890*/
891
892QColor QQuickRectangleShape::fillColor() const
893{
894 Q_D(const QQuickRectangleShape);
895 return d->shapePath->fillColor();
896}
897
898void QQuickRectangleShape::setFillColor(const QColor &color)
899{
900 Q_D(QQuickRectangleShape);
901 d->shapePath->setFillColor(color);
902}
903
904/*!
905 \include shapepath.qdocinc {fillRule-property} {QtQuick.Shapes.DesignHelpers::RectangleShape}
906*/
907
908QQuickShapePath::FillRule QQuickRectangleShape::fillRule() const
909{
910 Q_D(const QQuickRectangleShape);
911 return d->shapePath->fillRule();
912}
913
914void QQuickRectangleShape::setFillRule(QQuickShapePath::FillRule fillRule)
915{
916 Q_D(QQuickRectangleShape);
917 d->shapePath->setFillRule(fillRule);
918}
919
920/*!
921 \include shapepath.qdocinc {joinStyle-property} {QtQuick.Shapes.DesignHelpers::RectangleShape}
922*/
923
924QQuickShapePath::JoinStyle QQuickRectangleShape::joinStyle() const
925{
926 Q_D(const QQuickRectangleShape);
927 return d->shapePath->joinStyle();
928}
929
930void QQuickRectangleShape::setJoinStyle(QQuickShapePath::JoinStyle style)
931{
932 Q_D(QQuickRectangleShape);
933 d->shapePath->setJoinStyle(style);
934}
935
936int QQuickRectangleShape::miterLimit() const
937{
938 Q_D(const QQuickRectangleShape);
939 return d->shapePath->miterLimit();
940}
941
942void QQuickRectangleShape::setMiterLimit(int limit)
943{
944 Q_D(QQuickRectangleShape);
945 d->shapePath->setMiterLimit(limit);
946}
947
948/*!
949 \include shapepath.qdocinc {capStyle-property} {QtQuick.Shapes.DesignHelpers::RectangleShape}
950*/
951
952QQuickShapePath::CapStyle QQuickRectangleShape::capStyle() const
953{
954 Q_D(const QQuickRectangleShape);
955 return d->shapePath->capStyle();
956}
957
958void QQuickRectangleShape::setCapStyle(QQuickShapePath::CapStyle style)
959{
960 Q_D(QQuickRectangleShape);
961 d->shapePath->setCapStyle(style);
962}
963
964/*!
965 \include shapepath.qdocinc {strokeStyle-property} {QtQuick.Shapes.DesignHelpers::RectangleShape}
966*/
967
968QQuickShapePath::StrokeStyle QQuickRectangleShape::strokeStyle() const
969{
970 Q_D(const QQuickRectangleShape);
971 return d->shapePath->strokeStyle();
972}
973
974void QQuickRectangleShape::setStrokeStyle(QQuickShapePath::StrokeStyle style)
975{
976 Q_D(QQuickRectangleShape);
977 d->shapePath->setStrokeStyle(style);
978}
979
980/*!
981 \include shapepath.qdocinc {dashOffset-property} {QtQuick.Shapes.DesignHelpers::RectangleShape}
982*/
983
984qreal QQuickRectangleShape::dashOffset() const
985{
986 Q_D(const QQuickRectangleShape);
987 return d->shapePath->dashOffset();
988}
989
990void QQuickRectangleShape::setDashOffset(qreal offset)
991{
992 Q_D(QQuickRectangleShape);
993 d->shapePath->setDashOffset(offset);
994}
995
996/*!
997 \include shapepath.qdocinc {dashPattern-property} {QtQuick.Shapes.DesignHelpers::RectangleShape}
998*/
999
1000QList<qreal> QQuickRectangleShape::dashPattern() const
1001{
1002 Q_D(const QQuickRectangleShape);
1003 return d->shapePath->dashPattern();
1004}
1005
1006void QQuickRectangleShape::setDashPattern(const QList<qreal> &array)
1007{
1008 Q_D(QQuickRectangleShape);
1009 d->shapePath->setDashPattern(array);
1010}
1011
1012/*!
1013 \qmlproperty ShapeGradient QtQuick.Shapes.DesignHelpers::RectangleShape::fillGradient
1014
1015 The fillGradient of the rectangle fill color.
1016
1017 By default, no fillGradient is enabled and the value is null. In this case, the
1018 fill uses a solid color based on the value of \l fillColor.
1019
1020 When set, \l fillColor is ignored and filling is done using one of the
1021 \l ShapeGradient subtypes.
1022
1023 \note The \l Gradient type cannot be used here. Rather, prefer using one of
1024 the advanced subtypes, like \l LinearGradient.
1025*/
1026QQuickShapeGradient *QQuickRectangleShape::fillGradient() const
1027{
1028 Q_D(const QQuickRectangleShape);
1029 return d->shapePath->fillGradient();
1030}
1031
1032void QQuickRectangleShape::setFillGradient(QQuickShapeGradient *fillGradient)
1033{
1034 Q_D(QQuickRectangleShape);
1035 d->shapePath->setFillGradient(fillGradient);
1036}
1037
1038void QQuickRectangleShape::resetFillGradient()
1039{
1040 setFillGradient(nullptr);
1041}
1042
1043/*!
1044 \qmlproperty enumeration QtQuick.Shapes.DesignHelpers::RectangleShape::borderMode
1045
1046 The \l borderMode property determines where the border is drawn along the
1047 edge of the rectangle.
1048
1049 \value RectangleShape.Inside
1050 The border is drawn along the inside edge of the item and does not
1051 affect the item width.
1052
1053 This is the default value.
1054 \value RectangleShape.Middle
1055 The border is drawn over the edge of the item and does not
1056 affect the item width.
1057 \value RectangleShape.Outside
1058 The border is drawn along the outside edge of the item and increases
1059 the item width by the value of \l strokeWidth.
1060
1061 \sa strokeWidth
1062*/
1063QQuickRectangleShape::BorderMode QQuickRectangleShape::borderMode() const
1064{
1065 Q_D(const QQuickRectangleShape);
1066 return d->borderMode;
1067}
1068
1069void QQuickRectangleShape::setBorderMode(BorderMode borderMode)
1070{
1071 Q_D(QQuickRectangleShape);
1072 if (borderMode == d->borderMode)
1073 return;
1074
1075 d->borderMode = borderMode;
1076 polish();
1077 emit borderModeChanged();
1078}
1079
1080void QQuickRectangleShape::resetBorderMode()
1081{
1082 setBorderMode(BorderMode::Inside);
1083}
1084
1085void QQuickRectangleShape::componentComplete()
1086{
1087 Q_D(QQuickRectangleShape);
1088 d->componentComplete = true;
1089 // Do this before componentComplete(), because we need the elements to be
1090 // present in order for the connections to them to be made.
1091 d->maybeUpdateElements();
1092 QQuickShape::componentComplete();
1093}
1094
1095QQuickItem *QQuickRectangleShape::fillItem() const
1096{
1097 Q_D(const QQuickRectangleShape);
1098 return d->shapePath->fillItem();
1099}
1100
1101void QQuickRectangleShape::setFillItem(QQuickItem *newFillItem)
1102{
1103 Q_D(QQuickRectangleShape);
1104 d->shapePath->setFillItem(newFillItem);
1105}
1106
1107void QQuickRectangleShape::itemChange(ItemChange change, const ItemChangeData &value)
1108{
1109 Q_D(QQuickRectangleShape);
1110 d->maybeUpdateElements();
1111
1112 QQuickItem::itemChange(change, value);
1113}
1114
1115void QQuickRectangleShape::updatePolish()
1116{
1117 Q_D(QQuickRectangleShape);
1118 const qreal rectWidth = d->width.valueBypassingBindings();
1119 const qreal rectHeight = d->height.valueBypassingBindings();
1120
1121 d->calculateIndependentRadii();
1122
1123 switch (d->borderMode) {
1124 case QQuickRectangleShape::BorderMode::Inside:
1125 d->borderOffset = d->shapePath->strokeWidth() * 0.5;
1126 break;
1127 case QQuickRectangleShape::BorderMode::Middle:
1128 d->borderOffset = 0;
1129 break;
1130 case QQuickRectangleShape::BorderMode::Outside:
1131 d->borderOffset = -d->shapePath->strokeWidth() * 0.5;
1132 break;
1133 }
1134
1135 switch (d->borderMode) {
1136 case QQuickRectangleShape::BorderMode::Outside:
1137 d->borderRadiusAdjustment = d->shapePath->strokeWidth() * 0.5;
1138 break;
1139 case QQuickRectangleShape::BorderMode::Middle:
1140 d->borderRadiusAdjustment = d->shapePath->strokeWidth();
1141 break;
1142 default:
1143 d->borderRadiusAdjustment = 0;
1144 break;
1145 }
1146
1147 switch (d->firstVisibleEdge) {
1148 case QQuickRectangleShapePrivate::Edge::Top:
1149 d->shapePath->setStartX(d->effectiveTopLeftRadius + d->borderOffset + d->borderRadiusAdjustment);
1150 d->shapePath->setStartY(d->borderOffset);
1151 break;
1152 case QQuickRectangleShapePrivate::Edge::Right:
1153 d->shapePath->setStartX(rectWidth - d->borderOffset);
1154 d->shapePath->setStartY(d->effectiveTopRightRadius + d->borderOffset + d->borderRadiusAdjustment);
1155 break;
1156 case QQuickRectangleShapePrivate::Edge::Bottom:
1157 d->shapePath->setStartX(rectWidth - d->effectiveBottomRightRadius - d->borderOffset - d->borderRadiusAdjustment);
1158 d->shapePath->setStartY(rectHeight - d->borderOffset);
1159 break;
1160 case QQuickRectangleShapePrivate::Edge::Left:
1161 d->shapePath->setStartX(d->borderOffset);
1162 d->shapePath->setStartY(rectHeight - d->effectiveBottomLeftRadius - d->borderOffset - d->borderRadiusAdjustment);
1163 break;
1164 default:
1165 Q_UNREACHABLE();
1166 }
1167
1168 if (d->topPathLine) {
1169 d->topPathLine->setX(rectWidth - d->effectiveTopRightRadius - d->borderOffset - d->borderRadiusAdjustment);
1170 d->topPathLine->setY(d->borderOffset);
1171 } else {
1172 d->topPathMove->setX(rectWidth - d->borderOffset);
1173 d->topPathMove->setY(d->effectiveTopRightRadius + d->borderOffset + d->borderRadiusAdjustment);
1174 }
1175
1176 if (d->topRightPathArc) {
1177 d->topRightPathArc->setX(rectWidth - d->borderOffset);
1178 d->topRightPathArc->setY(d->effectiveTopRightRadius + d->borderOffset + d->borderRadiusAdjustment);
1179 const bool topRightBevel = hasTopRightBevel();
1180 d->topRightPathArc->setRadiusX(topRightBevel ? 50000 : d->effectiveTopRightRadius + d->borderRadiusAdjustment);
1181 d->topRightPathArc->setRadiusY(topRightBevel ? 50000 : d->effectiveTopRightRadius + d->borderRadiusAdjustment);
1182 }
1183
1184 if (d->rightPathLine) {
1185 d->rightPathLine->setX(rectWidth - d->borderOffset);
1186 d->rightPathLine->setY(rectHeight - d->effectiveBottomRightRadius - d->borderOffset - d->borderRadiusAdjustment);
1187 } else {
1188 d->rightPathMove->setX(rectWidth - d->effectiveBottomRightRadius - d->borderOffset - d->borderRadiusAdjustment);
1189 d->rightPathMove->setY(rectHeight - d->borderOffset);
1190 }
1191
1192 if (d->bottomRightPathArc) {
1193 d->bottomRightPathArc->setX(rectWidth - d->effectiveBottomRightRadius - d->borderOffset - d->borderRadiusAdjustment);
1194 d->bottomRightPathArc->setY(rectHeight - d->borderOffset);
1195 const bool bottomRightBevel = hasBottomRightBevel();
1196 d->bottomRightPathArc->setRadiusX(bottomRightBevel ? 50000 : d->effectiveBottomRightRadius + d->borderRadiusAdjustment);
1197 d->bottomRightPathArc->setRadiusY(bottomRightBevel ? 50000 : d->effectiveBottomRightRadius + d->borderRadiusAdjustment);
1198 }
1199
1200 if (d->bottomPathLine) {
1201 d->bottomPathLine->setX(d->effectiveBottomLeftRadius + d->borderOffset + d->borderRadiusAdjustment);
1202 d->bottomPathLine->setY(rectHeight - d->borderOffset);
1203 } else {
1204 d->bottomPathMove->setX(d->borderOffset);
1205 d->bottomPathMove->setY(rectHeight - d->effectiveBottomLeftRadius - d->borderOffset - d->borderRadiusAdjustment);
1206 }
1207
1208 if (d->bottomLeftPathArc) {
1209 d->bottomLeftPathArc->setX(d->borderOffset);
1210 d->bottomLeftPathArc->setY(rectHeight - d->effectiveBottomLeftRadius - d->borderOffset - d->borderRadiusAdjustment);
1211 const bool bottomLeftBevel = hasBottomLeftBevel();
1212 d->bottomLeftPathArc->setRadiusX(bottomLeftBevel ? 50000 : d->effectiveBottomLeftRadius + d->borderRadiusAdjustment);
1213 d->bottomLeftPathArc->setRadiusY(bottomLeftBevel ? 50000 : d->effectiveBottomLeftRadius + d->borderRadiusAdjustment);
1214 }
1215
1216 if (d->leftPathLine) {
1217 d->leftPathLine->setX(d->borderOffset);
1218 d->leftPathLine->setY(d->effectiveTopLeftRadius + d->borderOffset + d->borderRadiusAdjustment);
1219 }
1220
1221 if (d->topLeftPathArc) {
1222 d->topLeftPathArc->setX(d->effectiveTopLeftRadius + d->borderOffset + d->borderRadiusAdjustment);
1223 d->topLeftPathArc->setY(d->borderOffset);
1224 const bool topLeftBevel = hasTopLeftBevel();
1225 d->topLeftPathArc->setRadiusX(topLeftBevel ? 50000 : d->effectiveTopLeftRadius + d->borderRadiusAdjustment);
1226 d->topLeftPathArc->setRadiusY(topLeftBevel ? 50000 : d->effectiveTopLeftRadius + d->borderRadiusAdjustment);
1227 }
1228
1229 // This does stuff with each path, so we want to call it after we've made our own changes.
1230 QQuickShape::updatePolish();
1231
1232 qCDebug(lcUpdatePolish) << "updatePolish:"
1233 << "width" << rectWidth
1234 << "height" << rectHeight
1235 << "borderMode" << d->borderMode
1236 << "strokeWidth" << d->shapePath->strokeWidth()
1237 << "etlr" << d->effectiveTopLeftRadius
1238 << "etrr" << d->effectiveTopRightRadius
1239 << "eblr" << d->effectiveBottomLeftRadius
1240 << "ebrr" << d->effectiveBottomRightRadius
1241 << "borderOffset" << d->borderOffset
1242 << "startX" << d->shapePath->startX()
1243 << "startY" << d->shapePath->startY();
1244}
1245
1246QT_END_NAMESPACE
1247
1248#include "moc_qquickrectangleshape_p.cpp"
Combined button and popup list for selecting options.
T * createElement(QQuickShapePath *shapePath, const char *objectName)