Re #8450. No C++11 range-based for loop in gcc 4.4.

But here we can use the Qt foreach construct instead.