[Interest] Automatic deletion of children of QObject

Jan Kundrát jkt at flaska.net
Wed Jun 13 04:07:57 CEST 2012

On 06/12/12 21:36, Jochen Becher wrote:
> In my case childB is not a child of childA but both are children of
> parent (widgets in the same group/layout). But childB has a reference to
> childA which might be accessed in destructor. So I have either:

If the reference is a weak one (ie. "use it if it's available, but don't
break when it's gone for some reason"), you can just use QPointer (or
better, as I've just learned, the QWeekPointer).

With kind regards,
Trojita, a fast e-mail client -- http://trojita.flaska.net/

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 262 bytes
Desc: OpenPGP digital signature
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20120613/754ed32b/attachment.sig>

More information about the Interest mailing list