[Development] Proposal: Deprecate QVector in Qt 6

Giuseppe D'Angelo giuseppe.dangelo at kdab.com
Thu Apr 23 21:00:19 CEST 2020


On 4/23/20 6:54 PM, Manuel Bergler wrote:
>> This is a documentation bug or a Creator bug. You're supposed to land on
>> this anchor:https://doc.qt.io/qt-5/qvariant.html#QVariantList-typedef
> Technically this is the correct place to land on, but it isn't
> helpful. Just like Julius, if I have a container most of the time I
> care about the API of the container, not about the API of the
> value_type.  So I expect to see the API for that container when I open
> the documentation, but when intuitively scrolling up to the list of
> member functions it sometimes takes several seconds for me to realize
> that I landed on the QVariant page instead. If it were written as
> QList<QVariant> I could choose to either open the documentation for
> QVariant or for QList.

This is still a suggestion for Qt Creator, though. Note that the link 
above contains links to both QList and QVariant.

> 
>>> And I have to remember if QStringList is the same as as QList<QString>,
>>> or if it's actually a different container with a different API.
>> In fact, it is-a QList<QString>. What's the problem here with its naming?
> The issue is that Qt itself is not consistent with the naming.
> QStringList is just an alias for QList<QString>, but e.g. QDomNodeList
> (https://doc.qt.io/qt-5/qdomnodelist.html) isn't. So unless you've
> frequently used the particular type you always have to look it up. If
> it were spelled as QList<QString> it'd be obvious.
> 

This is:

1) an indication that by using "List" in the type name we don't actually 
mean QList, but we mean "sequence of"; and/or
2) an API mistake.

Thanks,
-- 
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: S/MIME Cryptographic Signature
URL: <http://lists.qt-project.org/pipermail/development/attachments/20200423/b5f371a8/attachment.bin>


More information about the Development mailing list