答案:QFile和QTextSream
QTextStream我没尝试过,可跳转:
https://blog.csdn.net/haha_mingg/article/details/6884883
QFile可行,具体实例,可见https://blog.csdn.net/daizhiyan1/article/details/80596583里面对标准输入输出流的读写。
读取标准输入输出流的问题困扰了我挺久的..专门列出来,方便需要的人查找吧,欢迎交流。
bool QFile::open ( int fd, OpenMode mode )
This is an overloaded function.
Opens the existing file descriptor fd in the given mode. Returns true if successful; otherwise returns false.
When a QFile is opened using this function, close() does not actually close the file.
The QFile that is opened using this function is automatically set to be in raw mode; this means that the file input/output functions are slow. If you run into performance issues, you should try to use one of the other open functions.
Warning: If fd is not a regular file, e.g, it is 0 (stdin), 1 (stdout), or 2 (stderr), you may not be able to seek(). In those ca