[PyQt] Proposal for New-style Signals

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

On Thu Jan 24 10:34:37 GMT 2008, Phil Thompson wrote:
> On Thursday 24 January 2008, David Boddie wrote:

> > I still can't see the attraction of this syntax. I sort of see the point
> > of things like
> >
> >   button.clicked.emit()
> >
> > but the stage 2 connect syntax looks inside-out.
> Because it's focused on the sender rather than the receiver? Your suggestion 
> below does as well.

It's more perverse than that: it's focused on the signal itself. With the
classic syntax

  self.connect(button, SIGNAL("clicked()"), self.doSomething)

there's a nice pattern to follow:

  connect <sender> <signal> <receiver> <slot>

even when <receiver> and <slot> are combined. Ideally, you could combine the
<sender> and <signal>, but arguments complicate the issue. From a C++ user's
perspective, the self is redundant, but that's the case in lots of places in

With the signal-centric syntax, I think the meaning is different:


The signal is saying, "Connect me to this slot."

Not that there's anything wrong with that - it's just a different focus.

David Boddie
Lead Technical Writer, Trolltech ASA

More information about the PyQt mailing list