title: Qt: How do I handle the event of the user pressing the 'X' (close) button?
body: <p>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:</p>
  <p><img src="https://i.stack.imgur.com/rgFqm.png" alt="Close button of the window" /></p>
  <p>If there isn't a slot for this, is there any other way to trigger a function after the user presses the close button?</p>