According to this talk there is a certain pitfall when using C++11 range base for on Qt containers. Consider:
for
QList list; for(c
Qt has an implementation to resolve this, qAsConst (see https://doc.qt.io/qt-5/qtglobal.html#qAsConst). The documentation says that it is Qt's version of C++17's std::as_const().