In Qt, what is the slot that corresponds to the event of the user clicking the 'X' (close) button of the window frame, i.e., this button:

If there isn't a slot for this, is there any other way to trigger a function after the user presses the close button?
If you have a
QMainWindowyou can overridecloseEventmethod.If you're subclassing a
QDialog, thecloseEventwill not be called and so you have to overridereject():