Despite what everyone will tell you - that you don't deep copy Qt containers - there are situations in which you simply need to perform an actual deep copy instead of just a shallow one. To do that, use detach()
:
container1 = container2;
container1.detach();