[Development] QML Rectangle corner radius API for Qt 6.7

Lars Knoll lars at knoll.priv.no
Fri Dec 22 18:40:32 CET 2023


> On 22 Dec 2023, at 17:48, Giuseppe D'Angelo via Development <development at qt-project.org> wrote:
> 
> Il 22/12/23 17:08, Pierre-Yves Siret ha scritto:
>> I wouldn't want a radii grouped property just because of its name.
>> I much prefer writing topLeftRadius: 10 than radii.topLeft: 10.
>> The pedantic latin syntax doesn't help with the readability. Maybe that's just because I am not a native English speaker.
> 
> 
> It might be pedantic, but here's an excerpt from the docs:
> 
>> Individual corner **radii** can be set as well (see below).
> 
> 
> Anyhow, something like:
> 
>  borderRadius: { topLeft: 10; bottomRight: 10 }
> 
> (or cornerRadius or whatever) fixes the API issue I was mentioning, it's discoverable, it's "obvious", has minimal impact (1 property on Rectangle instead of 4), and it's also compact to write.

Yes, that’s what I had in mind. 

Naming wise I would vote for borderRadius, simply because that name and its behaviour is well known for most developers and designers from CSS. cornerRadius could be an alternative (I think Figma uses that name).

Cheers,
Lars


More information about the Development mailing list