Hi,
I was wondering why QTextStream() has a flush() method, but QDataStream() doesnt.
How do i flush a QDataStream()?
And is there any way i can get the QFile* used by a QDataStream, or at least the filename of the file beign written to?
thanks.
Hi,
I was wondering why QTextStream() has a flush() method, but QDataStream() doesnt.
How do i flush a QDataStream()?
And is there any way i can get the QFile* used by a QDataStream, or at least the filename of the file beign written to?
thanks.
You could use QDataStream::device() and cast it to QFile I guess...
yes, did`t see that. thanks.
Still wired that QTextStream has flush() and QDataStream doesnt...
After a brief look at the sources: QTextStream buffers the content in a QString and at the end (or when calling flush()) it writes the content to the device. This is to take care of encodeing etc. QDataSream on the other hand directly writes to the device hence no flush() is needed.
thanks for the answer!
Will have a look at the sources myself next time.
Bookmarks