Hi, I'm still new to Qt and was trying out threading. I wrote this
little code sample to simulate pooling of slow-running threads:
import time
from PySide.QtCore import QTime, QRunnable, QThreadPool
class Task(QRunnable):
def run(self):
t = QTime()
t.start()
time.sleep(2) # Sleep 2 seconds
print 'Slow thread has wasted', t.elapsed(), 'ms'
if __name__ == '__main__':
while True:
task = Task()
QThreadPool.globalInstance().start(task)
time.sleep(1) # Sleep 1 second
This segfaults when run under PySide, while it works with PyQt4. Is
this a bug or am I just going about this the wrong way?
_______________________________________________
PySide mailing list
[email protected]
http://lists.pyside.org/listinfo/pyside