Pyqt window close event. You have to make use of the QWidgets closeevent.

Pyqt window close event. They are also sent when you call QWidget.