Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

handdle close window action in pyqt5

class MainWindow(QWidget): # or QMainWindow
    ...

    def closeEvent(self, event):
        # do stuff
        if can_exit:
            event.accept() # let the window close
        else:
            event.ignore()
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #handdle #close #window #action
ADD COMMENT
Topic
Name
6+3 =