 <p>Implicit sharing in Qt follows the CoW (copy on write) paradigm - objects will implicitly share the same internal resource as long as it is not modified, if some of the copies attempts to modify the resource, it will be "detached" from the shared resource, copy it and apply the modifications to it. </p> <p>When object lifetime ends, it decrements the reference counter for the shared resource, and if it is zero that means no other object uses it, so it is deleted. If the reference count is more than zero, the resource remains alive until there are objects, referencing it.</p> <p>In case 1 the shared resource will be deleted, as there are no more objects referencing it.</p> <p>In case 2 it will be deleted as well, because <code>aImg</code> will be out of scope by the time <code>tImg</code> is deleted.</p>