[PyQt] New style signals question

Detlev Offenbach detlev at die-offenbachs.de
Thu Aug 12 10:22:01 BST 2010


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
> > _______________________________________________
> > PyQt mailing list    PyQt at riverbankcomputing.com
> > http://www.riverbankcomputing.com/mailman/listinfo/pyqt


-- 
Detlev Offenbach
detlev at die-offenbachs.de


More information about the PyQt mailing list