Hi,

I have a console application that uses QCoreApplication, and it is executed using exec():

Qt Code:
  1. int main()
  2. {
  3. QCoreApplication qtApp(argc, argv);
  4.  
  5. MsDbServer server;
  6. server.start();
  7.  
  8. return qtApp.exec();
  9. }
To copy to clipboard, switch view to plain text mode 

I want to perform some code clean-up when a user clicks on the "X" button on the top right corner of the console application. How can I detect when this window gets closed in this way?

Thanks