title: How automatically call destructor in qt when I want to exit the application?
body: <p>I use CAMA series (finger print module) for my application. In that document it said that recommended to use <code>EnrollStandByMode</code> command before exit the application. I create this command and call it in my destructor on QMainWindow in my application. (there is no problem here). But when I exit the application and again run it my finger print is confused and the response commands are incorrect.  After trace my code ,I saw the destructor not run when the application close with close button.</p>
  
  <p>This is my code to exit the qapp.  </p>
  
  <pre><code>void MainWindow::on_pushButton_clicked()
  {
      qDebug()«"QApplication::quit()";
      QApplication::quit();
  }  
  </code></pre>
  
  <p>I want to know how to call destructor before exit the application?</p>