My Qt Project uses .csv(not my choice) files to save and load data from ,as i am looking to deploy the app , how do i add these files into the release version and what changes to my code should i do ?
right now i am using QFile and giving it the full path to each file like so :
QFile Fich1("C:/Users/ahmed/Desktop/MyWork/QtProject/Bibliotheque/Arrays.csv");
CodePudding user response:
If you're looking to ship CSV files as part of your application, one good way to do it is to use Qt's resource-file system; then they will be compiled into your app so there's no chance of them getting lost/modified/moved.
OTOH if you want to ship CSV files with your app but as separate files (e.g. so that the user can see and load them using a file dialog), then you can package them together with the executable, and then use QCoreApplication::applicationDirPath() as the default directory for the QFileDialog to present to the user.