你的运行环境是?Qt版本,操作系统?
你的问题应该是进程间同步问题。
请判别:
1. 判断输出渠道,是stdout还是stderr?
2. 同步你的process,是否有用到下边的方法?
- waitForStarted() // blocks until the process has started.
- waitForReadyRead() // blocks until new data is available for reading on the current read channel.
- waitForBytesWritten() //blocks until one payload of data has been written to the process.
- waitForFinished() // blocks until the process has finished.
文档:http://qt-project.org/doc/qt-5.0/qtcore/qprocess.html#details
Good Luck
PS:
- -i : inspect interactively after running script; forces a prompt even
- if stdin does not appear to be a terminal; also PYTHONINSPECT=x
还有一种方法就是你的python脚本负责创建FIFO ,然后每次python有输出的时候就往FIFO里边写,Qt监视FIFO就行了。
这个方法我曾经有做过,这个case有点小复杂,你可以酌情考虑一下。
如果你问题还是没有解决,可以提供最简的例子,可以更好的帮你排查问题。