Fix clazy 'range-loop' warnings
Fix places where C++11 range-loops was used with non-const Qt containers (potential detach).