One of the QIODevice
reimplemented open()
methods in QFile
has a QFileDevice::FileHandleFlag
argument. Taking a look at the documentation for it there are two options with contradicting descriptions.
From the QFileDevice
documentation:
QFileDevice::AutoCloseHandle
– The file handle passed into open() should be closed by close(), the default behavior is that close just flushes the file and the application is responsible for closing the file handle. When opening a file by name, this flag is ignored as Qt always owns the file handle and must close it.
QFileDevice::DontCloseHandle
– If not explicitly closed, the underlying file handle is left open when the QFile object is destroyed.
So does Qt auto close files or not and does setting this option actually change anything?