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?
Printable View
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?
You can connect some other signal to it:Whenever object1 emits someSignal(), object2 will emit someOtherSignal().Code:
connect( object1, SIGNAL( someSignal() ), object2, SIGNAL( someOtherSignal() ) );
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.Quote:
Originally Posted by Morea