disconnect happens automatically?
-
wrote on 24 Sept 2021, 15:02 last edited by
I have an object that needs to send signals to the GUI, so I connect it to a slot.
However later I delete that object.
I noticed I can always say when I'm done with the object:disconnect(myObject);
However does this also happen automatically when its deallocator is called?
-
I have an object that needs to send signals to the GUI, so I connect it to a slot.
However later I delete that object.
I noticed I can always say when I'm done with the object:disconnect(myObject);
However does this also happen automatically when its deallocator is called?
wrote on 24 Sept 2021, 15:05 last edited by JonB@Publicnamer
Yep :)In general you don't need to worry about explicitly calling
disconnect()
. -
Properly explained in the documentation to QObject::disconnect(): 'A signal-slot connection is removed when either of the objects involved are destroyed.'
1/3