As the documentation says
Qt automatically takes a copy of the container
.

So make me correct, but isn't foreach loop something useful when iterating through the container holding pointers not entire objects, because in other way we use 2 times original_container_size amount of memory ?