QProcess setStandardOutputFile为nullDevice不起作用(win)

时间:2017-11-16 10:20:16

标签: qt stdout qprocess

我有一个QProcess,我无法丢弃Windows机器上的输出:

QProcess * pingProcess = new QProcess;

arguments "google.com" << "-n" << "1";

pingProcess->setStandardOutputFile(pingProcess->nullDevice());
pingProcess->setStandardErrorFile(pingProcess->nullDevice());
pingProcess->setProcessChannelMode(QProcess::SeparateChannels); 

int exitCode = pingProcess->execute("ping",arguments);

我仍然在命令行中输出ping

有什么想法吗?

0 个答案:

没有答案