[PyKDE] Dropping SIGNAL() and SLOT() in PyQt4?

David Boddie david at boddie.org.uk
Sun Feb 19 15:19:32 GMT 2006


On Sun Feb 19 15:30:53, Giovanni Bajo wrote:

> Phil Thompson <phil at riverbankcomputing.co.uk> wrote:
> 
> > (In fact I don't see why Qt still needs SIGNAL() and SLOT() - maybe
> > the speed penalty of the alternative is more an issue at the C++
> > level.)
> 
> Nah. There's boost::signal, which is a full-blown signal/slot implementation
> which works totally at compile time and has zero overhead. In fact, there is
> technically *nothing* that moc does which cannot be done with C++ and some
> advanced tecniques. But Trolltech seems to like the separate compilation
> step more than templates.

Indeed, but see these documents for a more complete discussion:

http://doc.trolltech.com/4.1/templates.html
http://scottcollins.net/articles/a-deeper-look-at-signals-and-slots.html

I think one of the motivations for using a preprocessor-based approach is
the continued lack of support for certain C++ advanced techniques with some
compilers. Nonetheless, the first document aims to provide other
justifications for using moc.

> > So, what so you think? Is dropping them to much of a cultural change?
> > (Of course they could also be made optional.)
> 
> I'm fine with dropping them as long as they're optional.

I also think it's fine to make them optional. Some people might appreciate
the explicit nature of SIGNAL and SLOT in their code.

I imagine it's still possible to distinguish between signals and slots with
this method, and continue to allow signals to be connected to signals without
ambiguity.

David




More information about the PyQt mailing list