title: How to show a dialog all by itself (without parent widget) in PyQt?
body: <p>In the context of a parent class like a main window, it is easy to pop up a dialog like a message box:</p>
  
  <pre><code>QMessageBox.information(self, "Title", "Here is your informative message")
  </code></pre>
  
  <p>This pops up the message I want, with parent being <code>self</code>, the widget already open. But what if I want to show such a dialog in the middle of a Python program all by itself (say, to tell them their program has finished running, or whatever), without invoking a parent class?</p>
  
  <p>I tried the following, and the dialog shows, but when I click OK my system hangs for a few seconds, no message is printed, and my Python kernel restarts (with no error message):</p>
  
  <pre><code>import sys
  from PyQt5.QtWidgets import QApplication, QMessageBox
  
  app = QApplication(sys.argv)
  mess = QMessageBox()
  mess.setText("Here is your message")
  mess.setStandardButtons(QMessageBox.Ok | QMessageBox.Cancel)
  returnValue = mess.exec_()
  if returnValue == QMessageBox.Ok:
      print("Clicked OK!")
  elif returnValue == QMessageBox.Cancel:
      print("Cancelled?!")
  print("\n\nNow we are done")
  </code></pre>
  
  <p>When I click Cancel, it seems to work fine. I am not sure what Qt rules I am breaking here. I could just roll my own little popup using a <code>QWidget</code> I suppose.</p>
  
  <p>I am in pyqt5/python 3.7 running in Spyder/iPython. When I run directly from the command line, it actually seems to work, so this could be an iPython or Spyder problem.</p>