Including external text files into the Qt project
-
wrote on 29 Nov 2019, 17:27 last edited by
Hello everyone
I have some text files that I'm reading on PC in a certain directory
and I would like to somehow include these text files in my Qt project
so that my app won't have troubles trying to load them when I run the app from my moblie phone or from an emulatorI'm using FILE as a pointer and fopen()and fgets()
so I want to "add an exisiting file" and use the relative path in my Qt project
so these files will become a part of my projectHow can I do this ?
Or is there a topic about such a problem? -
Hello everyone
I have some text files that I'm reading on PC in a certain directory
and I would like to somehow include these text files in my Qt project
so that my app won't have troubles trying to load them when I run the app from my moblie phone or from an emulatorI'm using FILE as a pointer and fopen()and fgets()
so I want to "add an exisiting file" and use the relative path in my Qt project
so these files will become a part of my projectHow can I do this ?
Or is there a topic about such a problem?wrote on 29 Nov 2019, 17:38 last edited by ODБOï@Rami hi
you can add the files to your resources https://doc.qt.io/qt-5/resources.html -
wrote on 29 Nov 2019, 17:54 last edited by
@LeLev Thank you very much, it helped 😍
-
wrote on 29 Nov 2019, 18:08 last edited by
@Rami just in case, keep in mind that files inside the Qt resource system should be read-only.
1/4