[PyQt] Proposal for New-style Signals

Doug Bell dougb at bellz.org
Thu Jan 24 12:55:08 GMT 2008


Hans-Peter Jansen wrote:
> Am Donnerstag, 24. Januar 2008 schrieb Doug Bell:
> > Of the 13 overloaded signals, how many have "int" and "const QString&"
> > choices?  That seems to be the most common overload - giving either an
> > item's index or its string value.  Perhaps choosing either int or
> > QString as the consistent default would make sense.  I'd suggest making
> > int the default, since it's usually easier to get the string if you have
> > the int than the reverse.
> >
> > This would be more consistent with the other 96% of signals, reducing
> > the chance that a newby would need the long form.  And it would simplify
> > things in cases where the slot doesn't need the value.
> 
> Doug, please keep projects like PyKDE (and PyQwt?) in mind, where things 
> aren't so straight, as in Qt. IMHO, better use a slightly verbose, but 
> universally applicable variant. This won't make maintainers life of those 
> and probably countless others ;-) more complicated then necessary to adapt 
> the new scheme.

You're right that I wasn't considering PyKDE (I don't currently use it).
But the long form of connect would still be available when necessary.

There is some validity to the argument for one obvious (and verbose) way
to do it.  I'm just suggesting that, if there is a short form that omits
arguments, it should work in as many cases as possible.

Doug.


More information about the PyQt mailing list