使用 QTextStream 做你想做的事是不可能的。
请阅读以下链接:
http://qt-project.org/doc/qt-4.8/qtextstream.html
读取文本文件时使用 QTextStream 的一般方式有以下三种:
Chunk by chunk, by calling readLine() or readAll().
Word by word. QTextStream supports streaming into QStrings, QByteArrays and char* buffers. Words are delimited by space, and leading white space is automatically skipped.
Character by character, by streaming into QChar or char types. This method is often used for convenient input handling when parsing files, independent of character encoding and end-of-line semantics. To skip white space, call skipWhiteSpace().
建议:如果您正在生成文件,请不要在文件名之间使用空格。使用下划线。