PDA

View Full Version : Passing signals



gruszczy
15th July 2008, 17:09
Hello there!

I would like to create wrapper widget, that will hold some other (not specified) widget inside (and some other, this time quite concrete widget - QLineEdit). What I need is to catch all signal from this inner widget and pass them outside - but I don't know which signal inner widget emits. Is there any way to connect all signal from a widget to a one slot and then emit them again without letting my wrapper know anything about those signals?

jpn
15th July 2008, 18:30
You can declare the signals in your wrapper widget and connect inner widget signals to wrapper widget signals directly.

connect(lineEdit, SIGNAL(returnPressed()), this, SIGNAL(returnPressed()));
Making it dynamic (http://doc.trolltech.com/qq/qq16-dynamicqobject.html) like you describe is not a straightforward thing to do.. :)

gruszczy
16th July 2008, 14:19
Great, thanks. I'll take a look :)