python - PyQt Thread not running -
i trying run long running test suite background thread pyqt. on osx thread never runs, on windows thread runs if include print statement after starting thread. code looks this:
def runmoduletests(self): self.stackedwidget.setcurrentindex(2) self.testthread = qtcore.qthread() tr = testrunner(self.on_testresult, self.modulearticlenumber, self.moduleserialnumber, self.testbedarticlenumber) tr.movetothread(self.testthread) tr.testfinished.connect(self.testthread.quit) self.testthread.started.connect(tr.runmoduletests) self.testthread.start() print "this print out here make threads work. ugly hack!" i have these questions:
- is print statement causing gui yield on windows, other thread starts?
- how can thread start on both mac osx , windows?
- does gil mean cannot responsive ui using pyqt?
- am doing things wrong way?
i have taken inspiration answer question: background thread qthread in pyqt
the comment @zaiborg missing. need keep handle on object if move thread.
Comments
Post a Comment