navi::navi(QWidget *parent) : QX11EmbedContainer(parent){ QString wId = QString::number(winId()); setenv("NAVIT_XID", wId.toAscii(), 1); process = new QProcess(this); process->start("navit");}
C++ (Qt)#include <QApplication>#include <QX11EmbedWidget>#include <QX11EmbedContainer>#include <QVBoxLayout>#include <QHBoxLayout>#include <QLineEdit>#include <QPushButton>#include <QGroupBox>#include <QProcess> int main( int argc, char* argv[] ){ QApplication a( argc, argv ); QWidget* w; if( argc > 1 ) w = new QWidget; else w = new QX11EmbedWidget; QVBoxLayout vl( w ); QHBoxLayout l; vl.addLayout( &l ); QPushButton pb1( "One" ); QPushButton pb2( "Two" ); QLineEdit le1; QLineEdit le2; l.addWidget( &pb1 ); l.addWidget( &le1 ); l.addWidget( &pb2 ); l.addWidget( &le2 ); QX11EmbedContainer* ec; if( argc > 1 ) { QGroupBox* gb = new QGroupBox( "Containter" ); vl.addWidget( gb ); QHBoxLayout* l = new QHBoxLayout( gb ); ec = new QX11EmbedContainer; l->addWidget( ec ); } w->show(); QProcess* proc; if( argc > 1 ) { ec->embedClient( atol( argv[1] ) ); } else { proc = new QProcess( w ); proc->start( (const char*) argv[0], QStringList( QString::number( w->winId() ) ) ); } return a.exec();}