<html><head></head><body><div>I wouldn't treat that "List" as type information but rather as "container of objects" or simply "multiple objects".</div><div>Otherwise all functions would need type information in them aka "isActive()" becomes "isActiveBool()".</div><div><br></div><div>Dan</div><br><div><strong>
From:
</strong>
 
Jaroslaw Kobus <Jaroslaw.Kobus@qt.io>
<br>
<strong>
To:
</strong>
 
André Somers <andre@familiesomers.nl>, "development@qt-project.org" <development@qt-project.org>
<br>
<strong>
Sent:
 
</strong>
4/23/2020 11:58 AM
<br>
<strong>
Subject:
</strong>
 
Re: [Development] Proposal: Deprecate QVector in Qt 6
<br><br><blockquote class="mori" style="margin:0 0 0 .8ex;border-left:1px solid #CCC;padding-left:1ex;">There are cases, where the name of the function contains the "list", like:<br><br>QList<QMdiSubWindow *> QMdiArea::subWindowList(QMdiArea::WindowOrder order = CreationOrder) const;<br>QList<QPair<qreal, QPointF> > QGraphicsItemAnimation::translationList() const;<br>QList<QLowEnergyAdvertisingParameters::AddressInfo> QLowEnergyAdvertisingParameters::whiteList() const;<br>etc...<br><br>So, subWindowList() returning the vector?<br><br>Changing QList to QVector may in consequence require even more API changes.<br><br>Jarek<br><br>________________________________________<br>From: Development <development-bounces@qt-project.org> on behalf of André Somers <andre@familiesomers.nl><br>Sent: Thursday, April 23, 2020 11:21 AM<br>To: development@qt-project.org<br>Subject: Re: [Development] Proposal: Deprecate QVector in Qt 6<br><br>Hi Simon,<br><br><br>On 23-04-20 10:55, Simon Hausmann wrote:<br>Hi,<br><br>So take for example this function in QIconEngine:<br><br>    virtual QList<QSize> availableSizes(QIcon::Mode mode = Icon::Normal, QIcon::State state = QIcon::Off) const;<br><br>If we change that to QVector, we require our users to clutter their code base with #ifdefs. If we keep it with QList but use QVector in all non-virtual functions, then we create a less consistent API.<br><br>Do you think the #ifdefs or inconsistency is worth the proximity to the standard? (despite QVector not being like std::vector due to CoW semantics)<br><br>I may be missing the obvious, but I really fail to see the problem if you change the signature to<br><br>   virtual QVector<QSize> availableSizes(...);<br><br><br>If we have that<br><br>    template<typename T> using QList = QVector<T>;<br><br><br>a subclass reimplementing using QList should just work in both Qt5 and Qt6, right? So what #ifdef's would be needed?<br><br><br>And yes, I _do_ think staying close to the established meaning of what is a vector and what is a list is good. Getting list of QList (which is not a list) brings us closer to that goal.<br><br><br>André<br><br><br><br>Simon<br>________________________________<br>From: Daniel Engelke <daniel.engelke@basyskom.com><mailto:daniel.engelke@basyskom.com><br>Sent: Thursday, April 23, 2020 10:52<br>To: Simon Hausmann <Simon.Hausmann@qt.io><mailto:Simon.Hausmann@qt.io><br>Cc: development@qt-project.org<mailto:development@qt-project.org> <development@qt-project.org><mailto:development@qt-project.org><br>Subject: Re: [Development] Proposal: Deprecate QVector in Qt 6<br><br>Hi Simon,<br><br>I think having a name that is close to the standard is very important as it makes it easy to find the Qt counterpart.<br>Back in the days I had to ask a StackOverflow question to find Qts unique_ptr (QScopedPointer), because I couldn't find it due to the naming.<br><br>Dmitriy also has a very valid point. It is burned in a lot of peoples heads that using QList is a bad idea.<br><br>I don't see a lot of work in string replacing QList with QVector and QStringList with whatever it would be, as long as the API is compatible.<br>It's even less work if auto has been used.<br><br>Dan<br><br><br>From: Simon Hausmann <Simon.Hausmann@qt.io><mailto:Simon.Hausmann@qt.io><br>To: Dmitriy Purgin <dpurgin@gmail.com><mailto:dpurgin@gmail.com><br>Cc: "development@qt-project.org"<mailto:development@qt-project.org> <development@qt-project.org><mailto:development@qt-project.org><br>Sent: 4/23/2020 10:27 AM<br>Subject: Re: [Development] Proposal: Deprecate QVector in Qt 6<br><br>Hi Dmitriy,<br><br>No, this is not an April's Foolk joke.<br><br>Previous discussions were largely centred around the implementations and bringing them together. With this thread my concern is the API and the churn our users would have to apply to their code base in order to use Qt 5 and Qt 6.<br><br><br>Simon<br>________________________________<br>From: Dmitriy Purgin <dpurgin@gmail.com><mailto:dpurgin@gmail.com><br>Sent: Thursday, April 23, 2020 9:53<br>To: Simon Hausmann <Simon.Hausmann@qt.io><mailto:Simon.Hausmann@qt.io><br>Cc: development@qt-project.org<mailto:development@qt-project.org> <development@qt-project.org><mailto:development@qt-project.org><br>Subject: Re: [Development] Proposal: Deprecate QVector in Qt 6<br><br>Hi Simon,<br><br>I hope it's not a belated April's Fool joke? As far as I can remember, for the past few years, one would read everywhere to switch to QVector from QList because of this and that, and to choose QVector as the default choice container instead of QList like it was back in the days. I can't give the exact references but that's just the feeling I get from reading the docs and the Qt mailing lists.<br><br>Cheers<br>Dmitriy<br><br>On Thu, Apr 23, 2020 at 9:45 AM Simon Hausmann <Simon.Hausmann@qt.io<mailto:Simon.Hausmann@qt.io>> wrote:<br>Hi,<br><br>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):<br><br>    (1) Use the same type throughout the public API of Qt.<br><br>    (2) Make it easy for our users to maintain a code base that works with Qt 5 and 6.<br><br><br>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.<br><br><br>What do you think?<br><br><br>Simon<br>_______________________________________________<br>Development mailing list<br>Development@qt-project.org<mailto:Development@qt-project.org><br>https://lists.qt-project.org/listinfo/development<br><br><br>_______________________________________________<br>Development mailing list<br>Development@qt-project.org<mailto:Development@qt-project.org><br>https://lists.qt-project.org/listinfo/development<br><br><br><br>_______________________________________________<br>Development mailing list<br>Development@qt-project.org<mailto:Development@qt-project.org><br>https://lists.qt-project.org/listinfo/development<br><br>_______________________________________________<br>Development mailing list<br>Development@qt-project.org<br>https://lists.qt-project.org/listinfo/development<br></blockquote></div></body></html>