QT 调用外部进程,带参运行

 

 

 

 QProcess *process = new QProcess(this);
    QString path = QCoreApplication::applicationDirPath() + "/qtScreenShot.exe";
    QStringList str;
    QString filePathName = "123”;
    pixPath += filePathName;
    str << pixPath
        << QString("%1").arg(x)
        << QString("%1").arg(y)
    bool isStart = process->startDetached(path, str);/第一个参数path是被调用的exe名字,第二个参数是exe运行需要的参数,可不填

你可能感兴趣的:(QT学习)