title: Quit application call twice the closeevent
body: <p>I have wrote an application in Qt/c++ on OSX. When quitting the app, I'm catching the closeevent to display dialog box </p>
  
  <pre><code>void MainUI::closeEvent (QCloseEvent *event)
  {
      if( DeviceUnplugged == false) {
          ExitDialog = new DialogExit;
          ExitDialog-&gt;exec();
          if(ExitDialog-&gt;result() == QDialog::Accepted) {
              m_device.CloseDevice();
              event-&gt;accept();
          }
          else {
              event-&gt;ignore();
          }
      }
  }
  </code></pre>
  
  <p>The dialog box is correctly displayed when closing using the red cross or using the menu "quit".</p>
  
  <p>but when I'm closing the app using the right click on the icon in the dock, the dialog box appears twice the close event is called twice.</p>
  
  <p>Any idea why ?</p>