[PyQt] QThread not exiting
kreno at yumaed.org
Fri Oct 19 18:07:34 BST 2007
OK, I took out all the GUI elements, but I still can't get the QThread to
from PyQt4 import QtGui, QtCore
import time, sys
self.exiting = False
print 'got here'
while not self.exiting:
self.exiting = True
t = BusyThread(self)
app = QtGui.QApplication(args)
mainWindow = Menu()
if __name__ == '__main__':
On 10/19/07, Andreas Pakulat <apaku at gmx.de> wrote:
> On 19.10.07 09:25:05, Kerri Reno wrote:
> > I'm trying to run a progress bar in a QThread, while other stuff runs in
> > main thread. I can't get the QThread to exit. It just goes on
> forever. My
> > code is attached - please help!
> You can't. GUI elements can not work outside the main thread. If you
> have things that need a separate thread send signals from the threads
> run() method or post events which then get captured by the gui elements
> (either via a slot or a customEvent() function) and then can update the
> gui apropriately.
> Also if you access variables in your thread class from multiple threads
> you want to protect them against concurrent access, for example by using
> QMutexLocker with a QMutex.
> Advancement in position.
> PyQt mailing list PyQt at riverbankcomputing.com
Yuma Educational Computer Consortium
Compass Development Team
kreno at yumaed.org (928) 502-4240
.·:*¨¨*:·. .·:*¨¨*:·. .·:*¨¨*:·.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the PyQt