Loading [MathJax]/jax/output/HTML-CSS/jax.js

Ярлыки

суббота, 3 ноября 2012 г.

Threads in PyQt4


I want to create threads in PyQt4 fornormaluseGUI.

Make thread class:

class solveThreadQtCore.QThread:
        def runself:

              <what do you want doing>

Check for use thread with same name and kill it if yes:

        if hasattr(self,s1):
            delself.s1
        self.s1=solveThread



If I want terminate thread by button, I use variable self.isExit=0 in infinite while loop IdontuseThread.terminate( ). And I use refresh GUI each 5-10 sec (otherwise my GIU is freezing).

Комментариев нет:

Отправить комментарий