The following example should do what you want:
@
from PyQt4.QtCore import *
from PyQt4.QtGui import *
class Dialog(QDialog):
def init(self, parent=None, **kwargs):
QDialog.init(self, parent, **kwargs)
l=QVBoxLayout(self)
l.addWidget(QLabel("Waiting...", self))
l.addWidget(QProgressBar(self, minimum=0, maximum=0))
class MainWin(QDialog):
def init(self, parent=None, **kwargs):
QDialog.init(self, parent, **kwargs)
l=QVBoxLayout(self)
l.addWidget(QLabel("Ready!", self))
class WasteCPUTime(QObject):
finished=pyqtSignal()
@pyqtSlot()
def waste(self): self._timer=self.startTimer(10000)
def timerEvent(self, event):
self.finished.emit()
if name=="main":
from sys import argv, exit
a=QApplication(argv)
d=Dialog()
d.show()
m=MainWin()
w=WasteCPUTime()
t=QThread(started=w.waste)
w.finished.connect(t.quit)
t.finished.connect(m.show)
t.finished.connect(d.hide)
w.moveToThread(t)
t.start()
exit(a.exec_())
@
Generally speaking, its better to create an object with the functionality you require and move it to a QThread than it is to sub-class QThread directly. Also, this example uses signals and slots to communicate between threads rather than referencing the objects directly which I think is the cause of your issues.
Also, you may want to look at "QSplashScreen":http://pyqt.sourceforge.net/Docs/PyQt4/qsplashscreen.html.
Hope this helps ;o)