[PyQt] Overloading new-style signal

Phil Thompson phil at riverbankcomputing.com
Tue Feb 22 14:49:36 GMT 2011


On Sat, 19 Feb 2011 17:56:35 +0100, Knacktus <knacktus at googlemail.com>
wrote:
> Hi guys,
> 
> I don't get overloading of new-style signals to work. I can't spot the 
> mistake ... my eyes don't see anything anymore ;-).
> 
> Any help is highly appreciated.
> 
> Cheers,
> 
> Jan
> 
> Here's an example:
> 
> 
> import PyQt4.Qt as Qt
> import PyQt4.QtCore as QtCore
> 
> 
> class ItemsChangedNotifier(Qt.QObject):
> 
>      items_changed = QtCore.pyqtSignal([list], [dict])

The problem is that PyQt uses the same C++ class to represent a list and a
dict, so the above is actually defining two signals with the same
signature. The solution is to define them as separate signals.

I'll clarify the documentation.

Phil


More information about the PyQt mailing list