if i can know this, i can reduce some object produce and even can drop the emit action.
thanks in advance.
if i can know this, i can reduce some object produce and even can drop the emit action.
thanks in advance.
Wont it be better if you dont connect the slot to the signal.
Not emitting the signal cud hamper your functionality,, after all why is a signal used ?
hope am right
Emiting a signal is very cheap. It's a simple function call. If there are no slots connected, nothing more will happen.
yj_yulin (30th November 2008)
signals:
void a_happend(Tsomeobject * obj, int x, int y);
yeah, though signal is cheap, the object need to create(Tsomeobject * obj) maybe not.
and my situation also relate to the object management,thus if i can know there is no slots connected to the signal, it can reduce more work.
thanks for all involved, and especially to jpn.
I didn't say "single" Emiting a signal takes about 5-6 function calls but these are cheap compared to actual actions you take in the slot itself.
Yes, that's true. If you create an expensive object only to emit a signal then that's certainly a good idea to avoid the emission.
Bookmarks