I made a QGIS plugin but I didn't built it with the current structure because I need to keep the dialog window open during execution. So I didn't use a QDialogButtonBox for "Ok" and "Cancel" button, I just used two QPushButton in order to keep the window opened during execution. My problem is when I click on Cancel the dialog closed but the script keep running.
My code is as following :
def __init__(self, iface): self.dlg.ANNULER.clicked.connect(self.quitterProgramme) self.dlg.OK.clicked.connect(self.exeProgramme) def exeProgramme(self): if programmeExecute == False : self.monProgramme() else : self.quitterProgramme() def quitterProgramme(self): self.dlg.close()