[PyQt] Is the result of SIGNAL() a constant?

Aaron Digulla digulla at hepe.com
Wed Jan 9 10:13:55 GMT 2008

Quoting Henrik Pauli <henrik.pauli at gmail.com>:

>> But anyway: How much work would it be to have SIP generate constants
>> for all SIGNAL's in a class? So I could say:
>>      self.connect(w1, w1.SOME_SIGNAL, ...)
>> Pro: Doesn't break old code, API, etc. No more typos (or python will
>> warn about a missing attribute) and PyDev could offer auto-completion
>> for signals, too!
> Contra: doesn’t look like Qt at all,

What we have now maybe _looks_ like Qt but it isn't: In Qt, they use  
the C++ compiler magic to match signal names. So in Qt, you have  
syntax checking of signals but not in PyQt (there is not even an error  
when the signal is connected or used). Which one is more important?

Moreover, if you don't like it, you don't have to use it.

> and it’d be rather hard to know  just what
> to call different signals — especially ones sharing a name but differing in
> signature.

*this* is an issue. How many such signals are there? And let's not  
forget the slots, too.

When I did automatic code generators, I had an extra disambiguity map  
file to resolve these issues in a stable way. The map file would  
override the automatic guesses of the code generator.


Aaron "Optimizer" Digulla a.k.a. Philmann Dark
"It's not the universe that's limited, it's our imagination.
Follow me and I'll show you something beyond the limits."

More information about the PyQt mailing list