[Interest] QTemporaryFile::open(OpenMode flags) is protected, but not in documentation

Etienne Sandré-Chardonnal etienne.sandre at m4x.org
Thu Sep 26 10:57:46 CEST 2013


Hi Thiago,

Then I don't see the point of QTemporaryFile... You write some data and
can't do anything with it?

What are the legacy uses of it?
 - Open the file with a QFile for reading. Such use would be a large buffer
we do not want to keep in memory. But according to what you said, it must
be done before the QTemporaryFile was closed. Then, what guarantees the
writes have been flushed?
 - Write data to a temporary file before renaming it to the final name.
This is useful when a user saves a document overwriting the old version, in
case the system or app crashes he does not loose all the work. But
QFile::rename() closes before renaming, which means according to what you
said the data is not guaranteed to be still there.

I definitely need some additionnal explanation to the documentation on how
to use this class

Etienne


2013/9/26 Thiago Macieira <thiago.macieira at intel.com>

> Once you close the file, your data is gone. Your data only exists as long
> as
> you keep the file open.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20130926/7e5c2d5c/attachment.html>


More information about the Interest mailing list