mercredi 24 février 2016

How to prevent a QProcess to quit the program

I'm starting 'process' which runs 'program' once I push a button:

void MainWindow::on_Start_clicked() {
    QProcess* process = new QProcess(this);
    process->start("./program");
}

'Program' will run indefinitely until I push another button called 'on_Stop_clicked()'. The problem is, when I push 'on_Stop_clicked()' my program is closed.

What should I do in order to finish 'process' but still continue with my program opened?

Thank you.

Aucun commentaire:

Enregistrer un commentaire