[Development] QML Rectangle corner radius API for Qt 6.7
André Somers
andre at familiesomers.nl
Fri Dec 22 14:18:01 CET 2023
On 22-12-2023 14:12, Tor Arne Vestbø wrote:
>
>
>> On 22 Dec 2023, at 13:59, André Somers <andre at familiesomers.nl> wrote:
>>
>> And what type would the radius property return then? I guess it would
>> have to be the grouped type. But that would break all code that
>> currently creates a binding on radius expecting it to be a real.
>>
> True, that would not work too well. The grouped type would need to be
> convertible to a qreal I guess?
>
> What does `radius` return today, with the new API, when you’ve set
> only topLeftRadius?
It returns what it always did: a real with value 0.
The new API that is introduced in Qt 6.7 as it stands now just makes
that value act as the /default/ value for the more specific radii
properties. I think that that is sound design: it's backwards compatible
and consistent with things like anchors.margins providing the default
for the more specific margins (except for the fact that that property is
spelled margins (plural) while radius is singular.)
Anyway, I think that this is besides the point. The point I wanted to
raise was that having four separate properties isn't ideal, and that we
could give ourselves a lot of room for improvement by having a `corners`
grouped property that can contain more than just a single real value for
a radius.
André
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20231222/cc61b315/attachment.htm>
More information about the Development
mailing list