title: How to call QMessageBox Static API outside of a QWidget Sub-Class
body: <p>I have a utility class in my Qt GUI application. However, in my convenience class I wanted to call a <code>QMessageBox::critical()</code>, <code>warning()</code>, etc. The class isn't a <code>QWidget</code>, and therefore I cannot pass <code>this</code> as the parent. My class is subclassed from <code>QObject</code>, however, so it can run things such as signals and slots. So to work around this--if it's possible to--should I maybe look at the property API instead of using the Static API?</p>
  
  <p>Class declaration: </p>
  
  <pre><code>class NetworkManager : public QObject
  </code></pre>
  
  <p>And here's an example of a Static API call that fails:</p>
  
  <pre><code>QMessageBox::critical(this, tr("Network"), tr("Unable to connect to host.\n"),
  QMessageBox::Ok | QMessageBox::Discard);
  </code></pre>
  
  <p>So, if I were to build a Property based API message box, would it be possible to call it in a <code>QObject</code> somehow? I haven't really used the Property Based API, but I understand from the documentation that it seems to use an event loop (i.e. <code>exec()</code>).</p>