@Jeff-Andle
If you do not like that cleanup or if it is too hard to decide whether to free the memory you can use one oft these.
QSharedData
QSharedDataPointer
QSharedPointer
I have used QSharedDataPointer (but not the others so far), and it seems to work nice.