Answers for "handdle close window action in pyqt5"

0

handdle close window action in pyqt5

app = QApplication(sys.argv)
app.aboutToQuit.connect(myExitHandler) # myExitHandler is a callable
Posted by: Guest on January-08-2022
0

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()
Posted by: Guest on January-08-2022

Python Answers by Framework

Browse Popular Code Answers by Language