[Development] QML Rectangle corner radius API for Qt 6.7

Tor Arne Vestbø Tor.arne.Vestbo at qt.io
Fri Dec 22 14:09:44 CET 2023



On 22 Dec 2023, at 13:59, Lars Knoll <lars at knoll.priv.no> wrote:

You don't often get email from lars at knoll.priv.no<mailto:lars at knoll.priv.no>. Learn why this is important<https://aka.ms/LearnAboutSenderIdentification>

On 22 Dec 2023, at 13:54, Tor Arne Vestbø via Development <development at qt-project.org> wrote:

On 22 Dec 2023, at 13:20, Giuseppe D'Angelo via Development <development at qt-project.org> wrote:

Il 22/12/23 11:15, André Somers ha scritto:
I can see two options. The simplest option is to have a `radii`
property, which is a grouped property containing the `topLeft`,
`topRight`, `bottomLeft` and `bottomRight` properties as a floating
point value as we have now. I think that would be cleaner than the
current state of things.

While at it, it should be aptly named `cornersRadii` or similar.

`radius` has always violated Qt API guidelines. A rectangle doesn't have a radius. We shouldn't be doing the same mistake again.

Radius is a well established term for this in Qt, and other UI frameworks. A key principle in Qt’s API design is familiarity and consistency.

I’m not 100% sure about this. “Radius" without any pre/postfix is IMO somewhat confusing on a rectangle. HTML uses “borderRadius”, which I actually like quite a bit. And as it’s a new property, it would also not cause conflicts with the old name.

It’s not only affecting the border though, which can be a bit confusing perhaps? https://developer.mozilla.org/en-US/docs/Web/CSS/border-radius has an explicit note of that: "The radius applies to the whole background, even if the element has no border;”.

Tor Arne
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20231222/84a293af/attachment-0001.htm>


More information about the Development mailing list