Topic: fix deprecated warning QSet<T>::toList() Use values() instead.

can this be tested for correct operation? (qt5.xx)

works on Qt5.15.0

Issues count from 124 to 109

note: a guideline for adding code could be handy, if it already exists please teach me.

Post's attachments

Attachment icon 0001-fix-deprecated-warning-QSet-T-toList-Use-values-inst.patch 9.65 kb, 120 downloads since 2020-05-27 

Re: fix deprecated warning QSet<T>::toList() Use values() instead.

Hello, thanks for the patch, but in the Qt documentation I see the follwing note:

Note: Since Qt 5.14, range constructors are available for Qt's generic container classes and should be used in place of this method.

for both QList<T> QSet::toList() const and QList<T> QSet::values() const.
May be it's will be better to use range constructor, because values will probably be deprecated in future.

3 (edited by De-Backer 2020-05-28 12:21:57)

Re: fix deprecated warning QSet<T>::toList() Use values() instead.

ok, i look in to it if this is feasible for me.
https://doc.qt.io/qt-5/containers.html

QList<T>   

This is by far the most commonly used container class. It stores a list of values of a given type (T) that can be accessed by index. Internally, the QList is implemented using an array, ensuring that index-based access is very fast.
Items can be added at either end of the list using QList::append() and QList::prepend(), or they can be inserted in the middle using QList::insert(). More than any other container class, QList is highly optimized to expand to as little code as possible in the executable. QStringList inherits from QList<QString>

Re: fix deprecated warning QSet<T>::toList() Use values() instead.

Joshua wrote:

Hello, thanks for the patch, but in the Qt documentation I see the follwing note:

Note: Since Qt 5.14, range constructors are available for Qt's generic container classes and should be used in place of this method.

for both QList<T> QSet::toList() const and QList<T> QSet::values() const.
May be it's will be better to use range constructor, because values will probably be deprecated in future.

Hmm since Qt 5.14.... but I build QET packages for Debian Buster (Qt 5.11.x), Debian Sid (Qt 5.12.5) Ubuntu Bionic( Qt 5.9.).., etc... Only AppImage, macOS packages use Qt 5.14.2..maybe Flatpak and Snap.

For Qt 5.15 LTS it's still too early, I have a lot of problems with it.

/Qt/5.15.0/gcc_64/include/QtCore -Irelease -isystem /usr/include/libdrm -I. -I../../Qt/5.15.0/gcc_64/mkspecs/linux-g++ -o release/qetarguments.o ../sources/qetarguments.cpp
../sources/qetapp.cpp:44:25: fatal error: KAutoSaveFile: Aucun fichier ou dossier de ce type
 #include <KAutoSaveFile>
                         ^
compilation terminated.

Edit ; fixed

And sphinx error with ECM on MXE like this (No module named 'sphinxcontrib)
https://bugs.debian.org/cgi-bin/bugrepo … bug=955117

https://www.qt.io/blog/qt-online-instal … 3-released

argh ... I don't want to move to Qt shared libs for Windows is a pain for deploying under a cross-environment like MXE.

Re: fix deprecated warning QSet<T>::toList() Use values() instead.

Merged, thanks Simon.

Re: fix deprecated warning QSet<T>::toList() Use values() instead.

scorpio810 wrote:

Hmm since Qt 5.14.... but I build QET packages for Debian Buster (Qt 5.11.x), Debian Sid (Qt 5.12.5) Ubuntu Bionic( Qt 5.9.).., etc... Only AppImage, macOS packages use Qt 5.14.2..maybe Flatpak and Snap.

For Qt 5.15 LTS it's still too early, I have a lot of problems with it.

this is the feedback i needed.
QT 5.9 --- 5.14.2 max.

thanks.