[PyQt] Proposal for New-style Signals
Hans-Peter Jansen
hpj at urpla.net
Thu Jan 24 12:40:49 GMT 2008
Am Donnerstag, 24. Januar 2008 schrieb Doug Bell:
> Phil Thompson wrote:
> > About 4% of signals are overloaded. I think your point would be an
> > issue if that proportion was significantly higher, ie. if a newbie
> > would be likely to come across both short and long forms in, say, the
> > tutorials.
> >
> > Of the overloaded signals, none of the overloads are obvious candidates
> > for being the default - so in those cases there would be no default and
> > the long form would have to be used. In fact the only use of the
> > "default" flag would probably be to preserve backwards compatibility in
> > the event of a later version of Qt introducing a new overload.
>
> 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.
Pete
More information about the PyQt
mailing list