[Interest] Fwd: Lambda based connections are not disconnected upon QObject deletion

Thiago Macieira thiago.macieira at intel.com
Mon Sep 9 01:08:01 CEST 2013


On domingo, 8 de setembro de 2013 23:55:15, Philipp Kursawe wrote:
> Well, my example was not complete.Of course the lambda code does
> something in real. The problem seems to be, that Qt by itself does not
> delete lambda based connections properly.

it deletes them when the *sender* is deleted. It doesn't know what the lambda 
does, so there's no way to tell to delete when one of the variables inside the 
lambda becomes invalid.

In Qt 5.2, you will be able to associate them also with a receiver, in which 
case the connection will be deleted when either sender or receiver is deleted.

To do more complex things, keep the return result from connect() and use it to 
disconnect.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20130908/4d3d332c/attachment.sig>


More information about the Interest mailing list