I want to make sure I understand this right.

I have an implicitly shared container, say a QHash. Object A creates it and passes it to object B by value.

Qt Code:
  1. A
  2. {
  3. B.takeThis(QHash);
  4. }
To copy to clipboard, switch view to plain text mode 

So far, when reading from the QHash both A and B would read from the same memory block, right?

Now A modifies the QHash.

Qt Code:
  1. A
  2. {
  3. B.takeThis(QHash);
  4. QHash.addElement();
  5. }
To copy to clipboard, switch view to plain text mode 

Does the QHash get detached in this case? Or only when B modifies its own copy?

And if it does get detached, what happens when A modifies the QHash multiple times? Does it get detached every time?