Details
-
Bug
-
Resolution: Invalid
-
Not Evaluated
-
None
-
5.6.3, 5.9.7, 5.12.1
-
None
-
Gentoo Linux AMD64.
Description
I am unable to get to the data of an embedded binary file. The binary file is 43116 bytes, but when opening it using QResource, size() reports a size of 818 bytes, and data() points to garbage (or perhaps compressed data?)
This happens with all Qt versions I tried: 5.6.3, 5.9.7 and 5.12.1. (Using the official Linux 64-bit binary installer.)
resources.qrc file:
<RCC> <qresource prefix="/"> <file>data.bin</file> </qresource> </RCC>
qmake project:
QT -= gui CONFIG += c++11 console CONFIG -= app_bundle SOURCES += main.cpp RESOURCES += resources.qrc
main.cpp:
#include <QCoreApplication> #include <QResource> #include <iostream> int main(int argc, char* argv[]) { QCoreApplication a(argc, argv); QResource res(":/data.bin"); std::cout << res.size() << '\n'; }
This prints "818" and res.data() points to garbage.
"data.bin" is attached.