Store the file name and do not keep the QTemporaryFile around, which still seems to maintain some kind of lock on Windows although it is closed.