[Qt-interest] qfile and qtextstream oddities

Arnold Krille arnold at arnoldarts.de
Tue Jan 6 23:05:51 CET 2009


On Tuesday 06 January 2009 22:57:26 Mike A. Delaney wrote:
> I am trying to create a class that has a QFile and QTextStream member
> but I noticed that even though the QFile reports the file is open and
> writable anything I try to send to the QTextStream never shows up in the
> file; the file size remains zero. However, if I create a function and
> try to use the same open parameters and same method calls the text file
> is populated with the expected results.
> Can anyone help me figure out what I'm doing wrong?

Without looking at the example: You do know that Qt caches your data? So 
unless you write a lot of data (and fill Qt's buffer) it will only show on disk 
when you call flush() or finish writing and close the file.

Maybe that already answers your question...

Arnold
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090106/e75a960f/attachment.bin 


More information about the Qt-interest-old mailing list