On sexta-feira, 23 de agosto de 2013 14:33:06, Guido Seifert wrote:
> Of course I thought, that the problem is somewhere in my code, however, here
> is what I did: I created a QTemporaryFile object just to get a unique
> filename. I dropped the object at once, I did not use it. But with the
> unique filename I created a normal QFile. This I passed around exactly like
> I did with the QTemporaryFile. Actually I always passed only the filename
> around, never the file object itself. My functions opened and closed it.
> And this file I could delete without problems after I did not need it
> anymore. 
> 
> I think, if I did some coding error in one of my functions, it shouldn't
> have made a difference whether the filename belonged to a file, which was
> created via QTemporaryFile object, or via QFile object.
> 
> What do you think? A but, or do I overlook something?

QTemporaryFile keeps the file open. You can't delete it with QFile::remove, you 
have to let QTemporaryFile do it. Or, you must destroy the QTemporaryFile 
object first, so it will actually close the file. Then you can delete it.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center

Attachment: signature.asc
Description: This is a digitally signed message part.

_______________________________________________
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest

Reply via email to