[PyQt] New style signals question

Algis Kabaila akabaila at pcug.org.au
Thu Aug 12 02:26:07 BST 2010


On Thursday 12 August 2010 02:28:45 Detlev Offenbach wrote:
> Hi,
> 
> In my old code I have QTimer code like
> 
> QTimer.singleShot(0, self, SIGNAL("metaDataChanged()"))
> 
> How do I convert this to the new style signals code? I tried
> 
> QTimer.singleShot(0, self.metaDataChanged)
> 
> but this threw an error.
> 
> Regards,
> Detlev

In his "Rapid GUI Programming with Python and Qt" Mark 
Summerfield gives a summary of the following formats for 
SIGNAL -  SLOT connection formats (p129):

connect(w, SIGNAL('signalSignature'), functionName)
connect(w, SIGNAL('signalSignature'), instance.methodName)
connect(w, SIGNAL('signalSignature'), instace,
                           SLOT('slotSignature)

From this I concluded, rightly or wrongly,  that the SIGNAL
format is the same in the old and the new style and only 
the SLOT syntax has changed.  So perhaps you should 
look at the SLOT part of the statement?

HTH, 
OldAl.


More information about the PyQt mailing list