title: Starting Qt GUI from dll (in DLLStart function)
body: <p>I have to start a Qt GUI from a dll exposing <code>DLLStart</code> and <code>DLLStop</code>. The normal (.exe) approach in main is as follows:</p>
  
  <pre><code>int main(int argc, char *argv[]) {
      QApplication a(argc, argv); Dialog w;
      w.show();
      return a.exec();
  }
  </code></pre>
  
  <p>The problem is the blocking <code>a.exec()</code> call, since in the dll <code>DLLStart</code> needs to return immediately (see below). Any workaround for this? Remark: The question is sharing some common ground with " <a href="https://stackoverflow.com/questions/1048254/adding-a-qt-gui-to-a-dynamic-library">Adding a Qt GUI to a Dynamic Library</a> ", but it is no exact duplicate.</p>
  
  <pre><code>/** start module  */
  int __stdcall DLLStart(void) {
      .. 
      QApplication qaDll(ac, av); Dialog w;
      w.show();
      qaDll.exec();
      return 0; // never reached
  }
  
  /** stop module */
  void __stdcall DLLStop(void) { }
  </code></pre>