Get HANDLE from QFile
问题 I have a QFile , but I need to call some Win32 functions on it that accept only a HANDLE . Is there a way to retrieve the underlying HANDLE of the QFile ? 回答1: I found a way that uses _get_osfhandle() (available in MinGW and VS): QFile file; .... HANDLE handle = (HANDLE) _get_osfhandle(file.handle()). 来源: https://stackoverflow.com/questions/19707263/get-handle-from-qfile