Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
QProcess::waitForReadyRead当进程的标准错误中有数据时返回,还是只在标准输出上等待?如何在不使用信号和插槽的情况下等待 stderr 上的数据?
QProcess::waitForReadyRead
QProcess::setReadChannel()
将控制您是否监控标准错误或标准输出,所以如果您调用:
myProcess->setReadChannel( QProcess::StandardError );
然后waitForReadyRead只会作用于stderr。
waitForReadyRead
参见:QProcess::setProcessChannelMode