I am using a GUI with a checkbox made with QT and python, when the checkbox is checked i want to display 'stackoverflow' every 5 seconds, when it is unchecked i want it to do nothing. I have tried to call the following function when it is checked:
def work ():
threading.Timer(5, work).start ()
print "stackoverflow"
def checkbox(self, state):
if state == QtCore.Qt.Checked:
print 'checked'
work()
else: print 'unchecked'
But it keeps on printing 'stackoverflow'. How can i stop this?