Just a quick one, if I wish to emit a signal from a specific object, I can do like this, right?
emit myObject->mySignal();
Update: There doesn't seem to be any way of making a signal public. Or is there?
Just a quick one, if I wish to emit a signal from a specific object, I can do like this, right?
emit myObject->mySignal();
Update: There doesn't seem to be any way of making a signal public. Or is there?
Last edited by Morea; 26th February 2006 at 13:18.
You can connect some other signal to it:Whenever object1 emits someSignal(), object2 will emit someOtherSignal().Qt Code:
connect( object1, SIGNAL( someSignal() ), object2, SIGNAL( someOtherSignal() ) );To copy to clipboard, switch view to plain text mode
Objects can only emit their own signals (including inherited ones), not others'. Signals are protected functions and when the compiler reads your headers, it reads "protected:" rather than "signals:"; short of altering the Qt source code itself, you can't change this. This is covered in "Practical Qt" on page 231.Originally Posted by Morea
Bookmarks