qt - Is emitting a disconnected signal bad? -


i defined signal in myapp , emit in different places within code, need when my_defined_flag defined, question is:
should change every:

emit mysignal(); 

to

#ifdef my_defined_flag emit mysignal(); #endif 

?

and if answer "yes" then, there better idea?

the class emits signal shouldn't care if listens or not. users of class connect signals if need to, or not. maybe need connect of them. there no harm signal nobody connected to, call cheap. it's every other part of api: signals part of interface design, service provided class users, might use part of api, or not, own business.


Comments

Popular posts from this blog

c++ - How do I get a multi line tooltip in MFC -

asp.net - In javascript how to find the height and width -

c# - DataTable to EnumerableRowCollection -