[Development] Proposal: Deprecate QVector in Qt 6

Manuel Bergler berglerma at gmail.com
Thu Apr 23 18:54:14 CEST 2020


Am Do., 23. Apr. 2020 um 18:07 Uhr schrieb Giuseppe D'Angelo via
Development <development at qt-project.org>:
>
> On 4/23/20 5:04 PM, Julius Bullinger wrote:
> > Another suggestion: Get rid if the aliases; use the fully-qualified
> > types instead.
> >
> > I'm always irritated if I open the documentation of QVariantList from
> > within Qt Creator, and land on the QVariant docu instead. I'm interested
> > in the features of the container, not the contained type.
>
> 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.

>
> > 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.

>
> 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
>
> _______________________________________________
> Development mailing list
> Development at qt-project.org
> https://lists.qt-project.org/listinfo/development


More information about the Development mailing list