I want to call in my main program a method ExecuteM
where in a while
loop a text in my interface in Qt (call result
), done with Qt creator will be update for each iteration.
class Machine():
def __init__(self, result):
self.result=result
def ExecuteM(self, Var1, Var2):
while Var1 != 'stop':
Var2 = Var2 + 3
self.result.setText(newResult())
sleep(0.5)
then in my main script:
def main(self):
self.TM=Machine(self.result)
self.TM.ExecuteM(var1, var2)
but it does not work the text does not update at each iteration, why ?