int main(int argc, char *argv[]) { QApplication app(argc, argv); qDebug() << argc; qDebug() << argv[1]; if (app.arguments().count() != 2) { qFatal("Error - expected executable path as argument"); return 1; } QX11EmbedContainer mainWidget; mainWidget.show(); QProcess process(&mainWidget); QString executable(app.arguments()[1]); QStringList arguments; //arguments << QString::number(mainWidget.clientWinId()); arguments << QString::number(mainWidget.winId()); qDebug() << executable << arguments; process.start(executable, arguments); return app.exec(); }
int main(int argc, char *argv[]){ QApplication app(argc, argv); QX11EmbedContainer container; container.show(); QProcess * process = new QProcess(&container); QString executable("xterm"); QStringList arguments; arguments << "-into"; arguments << QString::number(container.winId()); process->start(executable, arguments); int status = app.exec(); process->close(); return status;}