title: QDialog keeps blocking mouse input even after close
body: <p>PyQt4/5 on OSX El Capitan</p>
  
  <p>I have a QMessageBox/QDialog which I want to be modal and want to block input from other GUI items while a process is running. The QDialog should provide the user the option to cancel the said process, but not allow him or her to do anything else with the GUI in the meantime.</p>
  
  <p>Once the process is finished, it should close the QDialog and enable input to the main application again. Because things should happen in the background while the dialog is shown, I am not using exec_() to display the dialog.</p>
  
  <p>Here is a simple example of my code:</p>
  
  <pre><code>self.openingDialog = QtWidgets.QMessageBox(self.main_window)
  self.openingDialog.setText(_(u"Opening experiment. Please wait"))
  self.openingDialog.setStandardButtons(QtWidgets.QMessageBox.Cancel)
  self.openingDialog.reject.connect(&lt;some_function&gt;)
  self.openingDialog.show()
  self.openingDialog.raise_()
  
  ... [Perform process] ...
  
  self.openingDialog.done(0)
  self.openingDialog.close()
  self.openingDialog.deleteLater()
  </code></pre>
  
  <p>Everything works nicely in the sense that the dialog box is shown, and that no interaction is possible with other GUI elements while it is displayed. However, when has process is finished, the dialog box is automatically closed but it is still not possible to interact with other GUI elements afterwards. The GUI does not respond to mouse clicks, menu items are not accessible, and you can't even click the close button, so the application needs to be Force Quit. </p>
  
  <p>What am I doing wrong in automatically closing the QDialog?</p>