diff options
author | Vincent Untz <vuntz@gnome.org> | 2012-03-02 15:36:01 +0100 |
---|---|---|
committer | Vincent Untz <vuntz@gnome.org> | 2012-03-02 15:36:01 +0100 |
commit | 94db110fab0dcea1f8f87efce6ce1be15a67dfc7 (patch) | |
tree | 5e04297a2a3a811f9097de50160c4533887a141e /xembed/tests/qt-common.cpp | |
parent | a988ef565a037a39aecca754a2f9d2f43e5c5131 (diff) | |
parent | 23d7d60971b8428429f120cbf77f3fcf70304b67 (diff) | |
download | xdg-specs-94db110fab0dcea1f8f87efce6ce1be15a67dfc7.tar.xz |
xembed: Merge import from CVS
Diffstat (limited to 'xembed/tests/qt-common.cpp')
-rw-r--r-- | xembed/tests/qt-common.cpp | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/xembed/tests/qt-common.cpp b/xembed/tests/qt-common.cpp new file mode 100644 index 0000000..9021d7e --- /dev/null +++ b/xembed/tests/qt-common.cpp @@ -0,0 +1,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 ()); + } +} + |