test.pro :
TEMPLATE = app TARGET = test INCLUDEPATH += . # Input SOURCES += main.cpp RESOURCES += test.qrc
test.qrc :
<!DOCTYPE RCC><RCC version="1.0"> <qresource> <file>MyFiles/myfile.txt</file> </qresource> </RCC>
main.cpp is your question. It works great.
However, if you still have a problem, you should post a minimal Qt project (including .pro and .qrc files) that has an error.
gatto
source share