Hello, I have the following code snippet which works fine with sleep, but does not do the intended thing with qtimer; I'll be grateful if someone could help me out:
***************************************************************************
#!/usr/bin/env python
from time import sleep
import sys
from PyQt4 import QtGui, QtCore
class Jrnl(QtGui.QDialog):
def __init__(self, parent = None):
QtGui.QDialog.__init__(self, parent)
self.createFe()
self.showFe()
def createFe(self):
# create widgets, layout, connections, etc
pass
def showFe(self):
self.show()
sleep(1)
jrnl = Jrnl()
####################
# The problem occurs if I replace the above 2 lines with
# the 4 lines below
####################
""" tmr = QtCore.QTimer(self)
QtCore.QObject.connect(tmr, QtCore.SIGNAL("timeout()"),
self.newJrnl)
tmr.start(1000) """
def newJrnl(self):
jrnl = Jrnl()
if __name__ == "__main__":
app = QtGui.QApplication(sys.argv)
jrnl = Jrnl()
sys.exit(app.exec_())
***************************************************************************
Basically, I want to replace sleep with qtimer, coz when the app enters
sleep, none of the created dialogs are refreshed (and appear to be hanged)
--
warm regards,
Pradnyesh Sawant
--
Always glad to share my ignorance - I've got plenty. --Anon
signature.asc
Description: Digital signature
_______________________________________________ PyQt mailing list [email protected] http://www.riverbankcomputing.com/mailman/listinfo/pyqt
