title: How can i stop QT Widget from closing?
body: <p>I have a class (Window) that inherits from QWidget (Not QMainWindow).
  This is the important part of my main function.</p>
  <pre><code> QApplication app (argc, argv);
  
   QMainWindow *window = new QMainWindow;
  
   QMenuBar *tool_bar = new QMenuBar (window);
  
   Window *graph_area = new Window (arguments);
  
   window-&gt;setMenuBar (tool_bar);
   window-&gt;setCentralWidget (graph_area);
   window-&gt;show ();
   app.exec ();
  </code></pre>
  <p>I thought that i would just override &quot;closeEvent&quot;, but for some reason it doesn't get called when pressing the closing button.</p>
  <p>I want to stop the user from closing the application if some process is still working.</p>
  <p>Any ideas about how i might achieve that?</p>