[Development] Proposal: Deprecate QVector in Qt 6

Simon Hausmann Simon.Hausmann at qt.io
Thu Apr 23 10:25:16 CEST 2020


Yes, the "proximity" of QVector to std::vector is on argument in favour of it. However I'm not certain that that's worth giving up on the goal of making it easy to maintain a code base between 5 and 6 with a consistent API in Qt. At the end of the day we serve our users 🙂

That said, what do you think we should do about this situation?

From: Development <development-bounces at qt-project.org> on behalf of Albert Astals Cid via Development <development at qt-project.org>
Sent: Thursday, April 23, 2020 10:06
To: development at qt-project.org <development at qt-project.org>
Subject: Re: [Development] Proposal: Deprecate QVector in Qt 6

El dijous, 23 d’abril de 2020, a les 9:43:33 CEST, Simon Hausmann va escriure:
> Hi,
> In dev we've had QVector being an alias for QList for a while now. For the
> 6.0 release this particular topic (QList/QVector) suggests two goals (among
> others):
>     (1) Use the same type throughout the public API of Qt.
>     (2) Make it easy for our users to maintain a code base that works with
> Qt 5 and 6.
> In the light of those two goals, I think we should keep using QList as the
> type in the public API. I don't think we should do a search and replace
> activity and switch to QVector. In the light of that, I would like to
> propose simply deprecating QVector and stick to QList everywhere.
> What do you think?

As taught in Computer Science/Engineering courses:
 * QList is not a list
 * QVector is a vector

Compating to std:: types:
 * QList is not comparable to a std::list
 * QVector is comparable to a std::vector

Personally i think it makes sense to keep the QVector name.


> Simon

Albert Astals Cid | albert.astals.cid at kdab.com | Senior Software Engineer
Klarälvdalens Datakonsult AB, a KDAB Group company
Tel: Sweden (HQ) +46-563-540090, USA +1-866-777-KDAB(5322)
KDAB - The Qt, C++ and OpenGL Experts

Development mailing list
Development at qt-project.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20200423/c3b598c4/attachment.html>

More information about the Development mailing list