Replaced Qt style foreach by native C++ foreach loop as introduced in C++11