Given a QFileDevice
instance (a QFile
, or QSaveFile
) - how would one get the native Windows HANDLE
of the file? And can this handle be used with ReOpenFile
?
相关问题
- QML: Cannot read property 'xxx' of undefin
- How to use Control.FromHandle?
- the application was unable to start correctly 0xc0
- QTextEdit.find() doesn't work in Python
- Inheritance impossible in Windows Runtime Componen
The
QFileDevice::handle()
returns a C file descriptor (fd
- a small integer) obtained fromQFSFileEnginePrivate::nativeHandle
. That file descriptor is what you'd get from_open_osfhandle
. You need to use_get_osfhandle
to go back to aHANDLE
.ReOpenFile
may return a different file handle, and thus you potentially need to reopen the file for it. An overloadedReOpenFile
handles it:The "missing"
open
that takes aHANDLE
is: