[PyQt] Proposal for New-style Signals

David Boddie dboddie at trolltech.com
Thu Jan 24 13:49:49 GMT 2008


On Thu Jan 24 13:40:47 GMT 2008, Phil Thompson wrote:
> On Thursday 24 January 2008, David Boddie wrote:

> > Not that there's anything wrong with that - it's just a different focus.
> 
> Yes, but your suggestion (which I like)...
> 
>     btn.connect("clicked()", self.on_clicked)
> 
> ...has the same issue.

Actually, I interpret the code as the button saying, "Connect my signal to
this slot," rather than the signal saying, "Connect me to this slot," as in
this code:

  btn.clicked.connect(self.on_clicked)

I think this signal-centric form lends itself better to situations where the
signals are declared in advance, like in Qt Jambi.

My suggestion is closer to the original syntax and just removes the redundant
"self" in those cases where it's not required. But, as you've already
noticed, my suggestion is more of a stage 1 thing, and the signal-centric
design is a stage 2 thing. :-)

David
-- 
David Boddie
Lead Technical Writer, Trolltech ASA


More information about the PyQt mailing list