[Development] Proposal: Deprecate QVector in Qt 6
Lars Knoll
lars.knoll at qt.io
Fri Apr 24 09:22:10 CEST 2020
> On 24 Apr 2020, at 09:11, Oliver Wolff <oliver.wolff at qt.io> wrote:
>
> Hi
>
> On 24.04.2020 08:57, Joerg Bornemann wrote:
>> On 4/23/20 15:52, Thiago Macieira wrote:
>>>> Proposed:
>>>>
>>>> template <typename T> using QVector = QList<T>; // mark deprecated
>>>> template <typename T> class QList { $(implementation to be moved); }
>>>
>>> Proposal 2:
>>>
>>> template <typename T> class QList { $(implementation to be moved); }
>>> template <typename T> using QVector = QList<T>;
>>>
>>> no deprecation.
>> +1 for proposal 2.
>> Alternatively, proposal 3 (aka "do almost nothing"):
>> template <typename T> class QVector { implementation }
>> template <typename T> using QList = QVector<T>;
>> No deprecation of QVector.
>> No replacement of QList with QVector in our API.
>> Rationale: QList is our default sequential container, and in Qt6 we just change its implementation.
>> The "people have been told many times to not use QList" argument can be countered with "this has been fixed in Qt6".
>> The "vector is a silly name from a mathematical standpoint" argument is valid, but vector is an established term in C++ world. Sorry, that ship has sailed.
>
> I am also in favor of proposal 2 or 3. I think deprecating either QList or QVector without any big advantage for the user will just make porting form Qt5 to Qt6 needlessly harder.
>
> Even inside Qt we are struggling to keep up with deprecation warnings (Thanks to Friedemann for fixing these). I am pretty sure Creator does have the same "problem". Extrapolating that from "just us" to the broader audience we are hopefully targetting, it looks like lots of users/applications will be hit by these warnings and it will mean (lots of?) work for them.
I do agree that we shouldn’t deprecate neither name, as that would just make moving from 5 to 6 harder. The unification of the classes should help simplify things.
But we need to have a consistent message around which name is the preferred one and used in Qt’s own API and documentation. Having a QList in one method and a QVector in the next one would only be confusing to our users. So IMO this thread should mainly be about deciding what the default name for this container is in our documentation and API in Qt 6.
Cheers,
Lars
>
> Cheers,
> Olli
>
>
>> Cheers,
>> Joerg
>> _______________________________________________
>> Development mailing list
>> Development at qt-project.org
>> https://lists.qt-project.org/listinfo/development
> _______________________________________________
> Development mailing list
> Development at qt-project.org
> https://lists.qt-project.org/listinfo/development
More information about the Development
mailing list