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,
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.
Amos
Qt Programmer Extraordinaire
Current Work:
Ripxx Sports Measurement Device - www.ripxx.com
(Featured in MYTHBUSTERS on 2010-05-19 in S08E08)
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.
Stelios: What the hell are you laughing at?
Astinos: Well, you had to say it!
Stelios: What?
Astinos: "Fight in the shade"!
-------------------------------------------
If my answer has helped you, i would appreciate it if you use the thanks button.
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
Bookmarks