#include #include #include #include #include #include using namespace std; int main(int argc, char **argv) { QCoreApplication app(argc, argv); for (int i = 0; i < 1000; ++i) { QProcess process; process.setProcessChannelMode(QProcess::ForwardedChannels); process.start("dbus-daemon", QStringList() << "--session" << "--address=tcp:host=localhost,port=0"); QTimer timer; QEventLoop eventloop; QObject::connect(&timer, SIGNAL(timeout()), &eventloop, SLOT(quit())); timer.setSingleShot(true); timer.start(100); eventloop.exec(); process.kill(); process.waitForFinished(); } cerr << "Program done" << endl; }