title: How to exit program with QCloseEvent?
body: <p>I have overridden the closeEvent function in the login dialog's .h file so that it exits the program when emitted:</p>
  
  <pre><code>    void closeEvent(QCloseEvent *event){exit(0)}
  </code></pre>
  
  <p>However, it seems to exit the program for whatever button in the dialog I click.
  How can I exit only when clicking the 'x' button in the upper-right corner?</p>