QProcess proc; QProcessEnvironment systemEnvironment; systemEnvironment.insert("PATH",systemEnvironment.value("PATH")+":/home/sasha/source/test/aaa"); proc.setEnvironment(QStringList() << "PATH=/home/sasha/source/test/aaa"); proc.setProcessEnvironment(systemEnvironment); proc.start("myprog --version"); qDebug() << proc.waitForFinished(); qDebug() << proc.errorString(); qDebug() << proc.readAllStandardError(); qDebug() << proc.readAllStandardOutput();
false"execve: No such file or directory"""""
proc.start("/home/sasha/source/test/aaa/myprog --version");
proc.start("myprog --version");
QStringList arg; arg << "--version"; proc.start("myprog", arg);