[PyQt] New style signals question

Phil Thompson phil at riverbankcomputing.com
Wed Aug 4 20:07:33 BST 2010


On Wed, 4 Aug 2010 19:50:54 +0200, detlev <detlev at die-offenbachs.de>
wrote:
> Hi,
> 
> in my code I have a line like
> 
> act.triggered.connect(self.myslot)
> 
> The slot has a method signature like
> 
> def myslot(self, fn = None, foo = "bar"):
> 
> However, it is always called with fn set to False. It seems that 
> triggered(bool) is the default signal. How do I get my slot connected to
> the 
> triggered() signal? Using the old style I could use
SIGNAL("triggered()").

Specific overloads are obtained by indexing the bound signal with the
signature you want, so...

act.triggered[()].connect(self.myslot)

Phil


More information about the PyQt mailing list