summaryrefslogtreecommitdiffstats
path: root/xembed/tests/qt-common.cpp
blob: 9021d7e407dc547d9b0d2cb6abdf10b8d614c4e5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#include "qt-common.h"

#include <qprocess.h>

XEmbedQtChildSite::XEmbedQtChildSite (QWidget *parent, bool active, bool isQt)
  : QXEmbed (parent)
{
  show ();
  
  QProcess *proc = new QProcess (this);

  proc->setCommunication (QProcess::Stdout);
    
  if (isQt)
    proc->addArgument ("./qt-client");
  else
    proc->addArgument ("./gtk-client");

  if (active)
    proc->addArgument (QString::number (winId ()));

  proc->start ();

  if (!active)
    {
      QString pid_str = proc->readLineStdout ();
      embed (pid_str.toLong ());
    }
}