I tryed a lot of things but they didnt work.
I'm using Qt 5.9.1 and i wouldlike to open a .txt file (which is in a qrc file) in a QFile variable, like this :
QFile file(":/txt/config");
I also tried to use
QFile file("qrc:/txt/config");
Here's the qrc file (summarized) :
<qresource prefix="/txt">
<file alias="config">resources/files/config.txt</file>
</qresource>
My .pro does have INCLUDEPATH += .
I have already tryed to :
Build -> Clean all
Build -> Run qmake
Build -> Build all
And it changed nothing, at every launch, I have this output :
QIODevice::read (QFile, ":/txt/config"): device not open
The path in .qrc is correct, QtCreator find the file when i browse the directories and open it in editor like a normal text file
Thanks for your help, and sorry for my english ... (and the edit function does not allow me to add hello everyone on the top, so i say it here :) )
make clean
and/orqmake
does not help. Try deletingMakefile
and/or generatedqrc_yourAppName.cpp
. – LeBlueRESOURCES += appName.qrc
or someting similar in the qmake/project file? – LeBlue