There was a task to stuff a json file into the project, which should keep some data in itself that will be overwritten by the program itself from time to time. The resource option (qrc) was not scanned, since files in it can only be opened in ReadOnly mode. But he doesn’t want to transfer the usual files to the release, despite the fact that there is a line in the pro-file

DISTFILES += \ data/test.txt 

The situation is complicated by the fact that this is a program for android, and I just can’t imagine where to put the json file with the data.

  • Maybe just a code cram, if small? (included) auto json = " #include "data.json" " - Vladimir Gamalyan
  • @VladimirGamalian in case of emergency I have a more accurate crutch but I would like to hear all the solutions - Amir Afendin
  • I can assume: the default settings are worn in a json file in resources, when you first start, save it to disk and then load from it and save to it. - gil9red

1 answer 1

Save it in the daddy any, standard ways can be taken from here http://doc.qt.io/qt-5/qstandardpaths.html