开发者

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

开发者 https://www.devze.com 2022-12-12 10:01 出处:网络
I want to have the output of qconf redirected to test_settings.txt in my tmp folder.I\'ve thought of two possibilities:

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开发者_JS百科 either of those work? Is there a better way?


QProcess procWriteProject;
procWriteProject.setStandardOutputFile("/tmp/test_settings.txt");
procWriteProject.start("qconf", QStringList() << "-sprj" << projectList[0]);
0

精彩评论

暂无评论...
验证码 换一张
取 消