title: Executing a qt application inside qt application
body: <p>I'm trying to embed several qt applications inside another one that only work as container. (I'm using linux)</p>
  
  <p>Lets call to the application container <strong>container</strong> and the one executed form container <strong>utility</strong></p>
  
  <p>In the <strong>container</strong> I have a QTabWidget, and inside this QTabWidget I have a Tab with a widget called utility1Widget. </p>
  
  <p>I want to see the GUI of the <strong>utility</strong> inside utility1Widget.</p>
  
  <p><strong>Edit2</strong>: The initial approach was wrong, I let it here for future references but a working implementation is in my separated answer.</p>
  
  <p>I have try without success get the WId of utility1Widget and to send it as arg at the start time of <strong>utility</strong>, something like:</p>
  
  <p>utility.cpp</p>
  
  <pre><code>int main(int argc, char *argv[])
  {
      QApplication a(argc, argv);
      int containerWinId;
      QWidget *parent=NULL;
      if(argc==2) {
          containerWinId=atoi(argv[1]);
          parent = QWidget::find(containerWinId);
      }
  
      MarinaWindowClient w(parent);
  
      w.show();
      printf("Starting client window. Do you see something?\r\n");
      fflush(stdout);
      return a.exec();
  }
  </code></pre>
  
  <p>As result the utility1Widget is empty but the utility GUI does not appear anywhere.</p>
  
  <p>The utility process is launched from <strong>container</strong> in this way:</p>
  
  <p>mainContainer.cpp</p>
  
  <pre><code>marinaContainer::mainContainer(QWidget *parent) :
      QWidget(parent),
      ui(new Ui::mainContainer)
  {
      ui-&gt;setupUi(this);
      WId myWinId=ui-&gt;utility1Widget-&gt;winId();
      char cmd[1000];
      sprintf(cmd," %d",myWinId);
      QProcess *myProcess = new QProcess(this);
      myProcess-&gt;start("utility1", QStringList(cmd));
  
      printf("Client started\r\n");
      fflush(stdout);
  }
  </code></pre>
  
  <p>Thanks!!!!</p>
  
  <p><strong>Edit 1</strong> I have added parent variable to inspect the result of find function, and it is NULL, so the first problem that I have is that I can't get container widget id, from utility.</p>