PDA

View Full Version : Qt5 signal/slot syntax - automatically disconnecting?



tuli
28th February 2015, 09:33
Quick question, I am in the process of moving to the new Qt5 signal/slot syntax. I am connecting instances of classes, no adventurous things like lambdas, function pointers or similar things.


With the old syntax, the connection was disconnected() when one of the participants was destroyed, and thus i never cared at all about diconnecting in my code. This behavior is still the same, right? The documentation is unclear here - it says manually disconnects are necessary, but i am pretty sure it refers only to lambdas (?).


During my tests automatically disconnecting seemed to work fine - but we are awfully close to the land of undefined behavior, so i wanted to ask.

wysota
28th February 2015, 16:20
This behavior is still the same, right?
Yes, nothing changed in this regard.