Commit Graph

3 Commits

Author SHA1 Message Date
Magdalena Stojek 727d235039 Refactor corner radius handling with explicit unset state
Replace the use of -1 to indicate unset corner radii with explicit
bitfield flags to track whether each corner radius is set.
The default value for unset radii remains 0.0.

Fixes: QTBUG-120188
Change-Id: If51a0165386a0c474ecd57ef23310d1c28f0f60b
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2025-02-21 08:33:57 +01:00
Lucie Gérard 9c5fc88388 Correct license for test files
According to QUIP-18 [1], all test files should be
LicenseRef-Qt-Commercial OR GPL-3.0-only

[1]: https://contribute.qt-project.org/quips/18

Pick-to: 6.7
Task-number: QTBUG-121787
Change-Id: I26d72e8de04d4c7c57b3b7838af5d033265de5ba
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2024-02-27 10:32:21 +01:00
Matthias Rauter ca20f7e82f Add a radius property for each corner of a Rectangle
This patch adds 4 properties to the Rectangle: topLeftRadius,
topRightRadius, bottomLeftRadius and bottomRightRadius. These properties
can be used to get a Rectangle where the corners have different radii.
If the properties are not set or if they are zero, the value of the
property radius will be used to draw the corner. If radius is zero too,
the corner will be drawn normally.

The opportunity was used to rename some variables in the
QSGRectangleNode and comment the code. We now use float as the storage
type for small-valued numbers, to reduce memory usage, even though the
setters take qreal values. They lose precision during rendering anyway.

[ChangeLog][QtQuick][Rectangle] Rectangle can now render individual
radii on each corner.

Fixes: QTBUG-48774
Change-Id: Icba1f6a26da513c657b7b218adc9187afb085eda
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2023-08-19 09:16:45 +02:00