How to deep copy QMap and other Qt containers

In general, what is the correct way to deep copy Qt containers? I'm not worried about deep copying containers recursively, although accessing those would be useful.

+7
source share
1 answer

Despite the fact that everyone will tell you that you do not have deep copies of Qt containers, there are situations when you just need to make the actual deep copy, not just a shallow one. To do this, use detach() :

 container1 = container2; container1.detach(); 
+11
source

All Articles