Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

If a Qt signal is emitted in the forest and noone is around to hear it, does it make a sound?

Sorry for the humorous phrasing of the question. I couldn't resist ;-)

If I emit a signal that's not connected to a slot anywhere in the code, is there still a performance cost associated with that "emission". I'm not familiar with the mechanism via which Qt's signal/slots are implemented, so I apologize if this question reveals my fundamental ignorance of Qt's underlying design.

like image 389
Alan Turing Avatar asked Jun 15 '11 01:06

Alan Turing


1 Answers

At least a small one. Qt at least needs to look into the signal's connected slot list (or something like this, not sure about that) until it sees that it doesn't have to call anything. But that performance hit should be negligable, considering that you're using such a high-level environment as Qt's signals and slots, anyway.

like image 60
Christian Rau Avatar answered Oct 23 '22 11:10

Christian Rau