Is it legal to emit a signal in a slot?
I am trying to emit a signal in a slot, and want to trigger another slot. The intended slot does not seems called. Wondering if it's legal to do that?
Thanks,
Printable View
Is it legal to emit a signal in a slot?
I am trying to emit a signal in a slot, and want to trigger another slot. The intended slot does not seems called. Wondering if it's legal to do that?
Thanks,
I have no trouble with it. You may want to be more clear by posting the nw code.
I have no problem either. This is legal.
Well, the connect() returned false. signal/slot signatures match.
rc=connect(p, SIGNAL(status(bool)),
this, SLOT(handStatus(bool)));
If it works for you, you can connect the signal with the other signal.
It can't fail at compilation time because introspection in Qt is done in run-time and not compile-time. Otherwise many of the features Qt offers couldn't be used.
qt spits out warnings about connections containing non-existant slots/signals to the console when the program is executed, so if you're using QtCreator, look at the application output panel, otherwise execute it from a console.
iirc you need to add CONFIG+=console if you're working on windows for that to work.
cheers,
thomas