KRect and KRectF proposal

Kevin Ottens ervin at kde.org
Fri Mar 27 20:44:46 GMT 2026


Hello,

On Friday, 27 March 2026 19:03:01 Central European Standard Time Vlad 
Zahorodnii wrote:
> I would like to propose adding a new library, e.g. kprimitivetypes, that
> would host `KRect` and `KRectF`.

The natural place would be kcoreaddons though as QRect(F) are in QtCore.

> There is a slight challenge with KF though. It will be nice if KConfig and
> maybe other tier 1 libraries are able use `KRect(F)`. In order to achieve
> that, the new library will need to live either outside of KF or perhaps
> there could be tier 0 in KF?

Is there any other concrete cases of tier 1 needing to depend on KRect(F) 
beyond KConfig?

As for KConfig itself, I'm not sure if the dependency is really required, the 
rect types are already going through the templated version of read/writeEntry 
which use QVariant. I think there is a path where we register conversion 
between QRect(F) and KRect(F) in the metatype system and where the internal 
implementation of KConfig leverages it (right now it's mostly limited to 
checking only userType IIRC). I'd expect we could sidestep a dependency from 
KConfig to KCoreAddons like this.

Again, I'm operating mostly from memory (although I checked a couple of 
points), so this likely needs to be investigated more.

Regards.
-- 
Kevin Ottens, http://ervin.ipsquad.net

enioka Haute Couture - proud supporting member of KDE
https://haute-couture.enioka.com/en
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-devel/attachments/20260327/e6fb10fd/attachment.sig>


More information about the kde-devel mailing list