[PyQt] Proposal for New-style Signals

Doug Bell dougb at bellz.org
Thu Jan 24 11:22:40 GMT 2008

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.


More information about the PyQt mailing list