Qfile and Qresource problem
Unsolved
General and Desktop
-
I am working with a few dictionaries and as I am cross-compiling it would be usefull if I would use the resource folder instead.
I was already using the Resource folder for a .jpg file but it is not working when I want to open my textfile.
QPixmap logo(":/resources/img/logo.jpg"); // works
QFile file(":/resources/img/Dictionary2.csv.txt"); // does not work
user@user:~/Dropbox/GUI/GUI_Qt/img$ ls Dictionary2.csv.txt logo.jpg toolbox1.png toolbox2.png // the file is present in the folder
What am I not knowing? ...besides alot :P
-
I am working with a few dictionaries and as I am cross-compiling it would be usefull if I would use the resource folder instead.
I was already using the Resource folder for a .jpg file but it is not working when I want to open my textfile.
QPixmap logo(":/resources/img/logo.jpg"); // works
QFile file(":/resources/img/Dictionary2.csv.txt"); // does not work
user@user:~/Dropbox/GUI/GUI_Qt/img$ ls Dictionary2.csv.txt logo.jpg toolbox1.png toolbox2.png // the file is present in the folder
What am I not knowing? ...besides alot :P
-
- Did you add
Dictionary2.csv.txt
to the qrc file? - Can you try
QFile file(QFileInfo(":/resources/img/Dictionary2.csv.txt").absoluteFilePath());
?
- Did you add