1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
| void IHM::on_pushButton_clicked()
{
QProcess *exec = new QProcess();
//Connexion à ajouter(pas très propre mais c'est pour l'exemple)
connect(exec, SIGNAL(readyRead()), this, SLOT(readOutput());
for (int i = 0; i<3; i++)
{
QStringList arg;
arg << "arg1"
exec->start("C:/prog.exe", arg);
exec->waitForFinished(-1);
//Suppression des lignes suivantes, on fait
//le traitement dans readOutput
//int nb = exec->bytesAvailable(); //nb=0
//QByteArray temp = exec->readAll(); //temp = ""
//ui->textBrowser->insertPlainText(temp.data());
}
} |
Partager