[PyQt] New style signals question

Algis Kabaila akabaila at pcug.org.au
Fri Aug 13 07:27:00 BST 2010


Thanks for posting it to the list - I've learned something from it!

OldAl.

On Thursday 12 August 2010 19:22:01 Detlev Offenbach wrote:
> Hi,
> 
> thanks. That was the solution.
> 
> Detlev
> 
> On Donnerstag, 12. August 2010, 机械唯物主义 : linjunhalida wrote:
> > It works!
> > 
> > from PyQt4.QtCore import *
> > from PyQt4.QtGui import *
> > 
> > class P(QPushButton):
> >     pass
> > 
> > app = QApplication([])
> > 
> > p = P()
> > p.clicked.connect(app.aboutQt)
> > p.show()
> > 
> > #QTimer.singleShot(1, app, SLOT("aboutQt()"))
> > 
> > QTimer.singleShot(1, lambda: p.clicked.emit(True))
> > 
> > app.exec_()
> > 
> > On Thu, Aug 12, 2010 at 12:28 AM, Detlev Offenbach
> > <detlev at die-offenbachs.de
> > 
> > > 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
> > > --
> > > Detlev Offenbach
> > > detlev at die-offenbachs.de
> > > _______________________________________________


More information about the PyQt mailing list