I'm using Qt for reading binary file. I read file with QFile object, but sometimes I need to go back at begining of the file and read file again, but I don't know how to do that.

有帮助吗?

解决方案

You can use the seek function on your file :

file.seek(0);

If you are reading the file using a QTextStream you should use the seek function on the stream.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top