[PyQt] QTimer.singleShot

Jason H scorp1us at yahoo.com
Wed Oct 7 04:49:45 BST 2009


I have a GUI application and I want to trigger an event after my GUI starts:
if __name__=="__main__":
    a = QApplication(sys.argv)
    
    m=Main(False)
    m.show()
    a.exec_()
    
I put "QTimer.singleShot(0, self.start)"
after the m __init__ialization, both in the class, and I also tried it after m.show() but the console just floods with:

QCoreApplication::exec: The event loop is already running
QCoreApplication::exec: The event loop is already running
QCoreApplication::exec: The event loop is already running
QCoreApplication::exec: The event loop is already running

What do I have to do to get my GUI started and using the existing event loop?



      


More information about the PyQt mailing list