vendredi 25 janvier 2019

Qt5: how to batch process by using QProcess

I want to let QProcess run many command at a time,instead of one at a time.

void Route::add_route()
{
    QProcess *Add_route = new QProcess(this);
    Add_route->start("notepad",QStringList() << "interface" << "ipv4" << "set" << "interface" << "" << "metric=1");
    Add_route->start("explorer",QStringList() << "interface" << "ipv6" << "set" << "interface" << "" << "metric=1");
    Add_route->waitForFinished();
}

By using this,it will only run the first one.
Ps: I'm using notepad and explorer just for test
Thanks!

Aucun commentaire:

Enregistrer un commentaire