Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I direct the output of a QProcess to a file?

Tags:

qt

qprocess

I want to have the output of qconf redirected to test_settings.txt in my tmp folder. I've thought of two possibilities:

QProcess procWriteProject;

procWriteProject.start("qconf", QStringList() << " -sprj "
    << projectList[0] << " >> " << "\"/tmp/testing.txt\"");

procWriteProject.start("qconf -sprj " + projectList[0] + " >> "
    + "/tmp/test_settings");

Will either of those work? Is there a better way?

like image 505
nish Avatar asked Nov 26 '09 18:11

nish


1 Answers

QProcess procWriteProject;
procWriteProject.setStandardOutputFile("/tmp/test_settings.txt");
procWriteProject.start("qconf", QStringList() << "-sprj" << projectList[0]);
like image 114
baysmith Avatar answered Sep 23 '22 02:09

baysmith