QFile::handle() returns -1 for files in resource
-
It seems QFile::handle() returns -1 for files in resource. It's not mentioned in the doc but is this expected behavior? I was hoping to get a valid file descriptor so that I can use other API that takes fd.
I'm sure the file was opened successfully as open() returned true. I tested on Ubuntu Linux with Qt 4.7.0.
-
For data in a Qt resource file (filename is ":/path/to/resource") there is no underlying file (the data itself is actually compiled into your executable), so there is no file descriptor either. You can use Qt resource only within Qt itself or extract the data to an array/QByteArray and hand that bunch of bytes over to your legacy code.