3

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()
  • What about using a dockwidget instead a dialog window? This way, the dockwidget can remain open until the user closes it. – Joseph Mar 10 '17 at 15:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.