[prev in list] [next in list] [prev in thread] [next in thread]
List: pykde
Subject: Re: [PyQt] Timers
From: Russell Valentine <russ () coldstonelabs ! org>
Date: 2010-01-26 5:51:36
Message-ID: 4B5E82E8.3010307 () coldstonelabs ! org
[Download RAW message or body]
Seems to work for me, and if it usually works for you, then it is
probably what you didn't include in your email that is not working?
#Does it for me
from PyQt4 import QtCore, QtGui
import sys
class Main(QtGui.QMainWindow):
def __init__(self):
QtGui.QMainWindow.__init__(self)
def startProcessing(self):
print "Processing"
if __name__=="__main__":
a = QtGui.QApplication(sys.argv)
m = Main()
m.show()
QtCore.QTimer.singleShot(0, m.startProcessing)
a.exec_()
Jason H wrote:
> I have a class that is created and needs to run a function after the event loop starts.
>
> Usually I just do:
> if __name__=="__main__":
> a = QApplication(sys.argv)
> m=Main(False)
> m.show()
> QTimer.singleShot(0, m.startProcessing)
> a.exec_()
>
>
> But my startProcessing slot does not get called.
>
> Ideas?
>
_______________________________________________
PyQt mailing list PyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic