Terminating QThread gracefully on QDialog reject(),time.sleep(0.5)