Don't use ranged for with a Qt container, at least not with non-const one.
On a non-const container, ranged for will call non-const begin/end, which will cause a Qt container to deep copy if its reference counter is > 1.
http://www.dvratil.cz/2015/06/qt-con...e-based-loops/
In general, use vector over list, e.g. QVector or std::vector instead of QList, unless you need the list features.
https://marcmutz.wordpress.com/effective-qt/containers/
Cheers,
_
Bookmarks