So if I understand correctly, the x11 program I want to run embeded, must have a way to specify the winId. Otherwise the QX11EmbedContainer will not work. This is the code that runs but doesn't work, I think it doesn't have a way to specify the winId as an argument.
#include <QX11EmbedContainer>
#include <QtGui>
#include <QProcess>
int main(int argc, char *argv[])
{
if (app.arguments().count() != 2) {
qFatal("Error - expected executable path as argument");
return 1;
}
container.show();
QString executable
(app.
arguments()[1]);
arguments <<
QString::number(container.
winId());
process.start(executable, arguments);
int status = app.exec();
process.close();
return status;
}
#include <QX11EmbedContainer>
#include <QtGui>
#include <QProcess>
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
if (app.arguments().count() != 2) {
qFatal("Error - expected executable path as argument");
return 1;
}
QX11EmbedContainer container;
container.show();
QProcess process(&container);
QString executable(app.arguments()[1]);
QStringList arguments;
arguments << QString::number(container.winId());
process.start(executable, arguments);
int status = app.exec();
process.close();
return status;
}
To copy to clipboard, switch view to plain text mode
Bookmarks