[Qt-interest] emitting signal from another class

Scott Aron Bloom Scott.Bloom at onshorecs.com
Thu Jul 15 17:44:40 CEST 2010


> John:
> 
> > Ooops. Signals are protected. Only the class that defines the signal
> > can emit the signal. What you need is a public member function that
> > emits the signal.
> 
> There's an "escape clause", though, isn't there? By connect()ing one
> signal to another, you can coerce a class to emit its signal in
> response to another class's compatible signal, right?
> 
> As long as the connect() has access to the right objects from both
> classes, you're in business.
> 
> Atlant
> 
> 
Yes.. you can absolutely connect one signal to another...

Another method, that I have used (as does the Qt source) is create a
"emitSignal" method

void MyClass::emitTheSignal( xxx, yyy )
{
	emit theSignal( xxx, yyy );
}





More information about the Qt-interest-old mailing list