I have folllowing piece of cake
def __init__():
self._taskInProgress = threading.Event()
def isFinished(self):
self._taskInProgress.clear()
self.progressBar.hide()
self.close()
def closeEvent(self, event):
if self._taskInProgress.is_set():
reply = QtGui.QMessageBox.question(self, "Are you sure you want to quit? ",
"Task is in progress !",
QtGui.QMessageBox.Yes,
QtGui.QMessageBox.No)
if reply == QtGui.QMessageBox.Yes:
event.accept()
else:
event.ignore()
the problem is if somebody closes the parent window(i.e. self) the above prompt shows up , but if somebody doesn't press yes or no in this message box the parent window doesn't closes.
So how should I achieve that when task finishes the QMessageBox
(i.e. reply) is also closed by iteslef, like calling reply.close()