[Development] qsizetype and classes working with QStrings or QList

Giuseppe D'Angelo giuseppe.dangelo at kdab.com
Thu Aug 27 19:17:31 CEST 2020


Hi,

Il 27/08/20 16:47, Thiago Macieira ha scritto:
> So, can someone take a look at what it would take to make the models use 64-
> bit and come up with a proper guide for how to maintain code that compiles and
> works on both Qt5 and Qt6? The latter is very important: if you can't easily
> maintain for both, we just add to users' pain. It might be as simple as a
> typedef added to QAbstractItemModel.

Finger in the wind: it's going to be painful. int-based APIs are used

- in virtuals in QAbstractItemModel (rowCount(), but also things like 
moveRows() which take int as parameter, so changing it is a straight API 
break)

- in Q(Persistent)ModelIndex

- in convenience subclasses like QStandardItemModel (and of course in 
the convenience views)

- in selection handling

- in the views' convenience handlers (e.g. QAbstractItemView::rowsInserted)


Long story short, I don't see this happening without also some 
configure-time switch for a "qaimsizetype" or somesuch.

My 2 c,
-- 
Giuseppe D'Angelo | giuseppe.dangelo at kdab.com | Senior Software Engineer
KDAB (France) S.A.S., a KDAB Group company
Tel. France +33 (0)4 90 84 08 53, http://www.kdab.com
KDAB - The Qt, C++ and OpenGL Experts

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4329 bytes
Desc: Firma crittografica S/MIME
URL: <http://lists.qt-project.org/pipermail/development/attachments/20200827/07a66232/attachment.bin>


More information about the Development mailing list