c++ - How to save content of the QSettings file on Android to make it readable after updating my app from Play Store? -


I have an application written in C ++, based on QT532 framework. I save the settings of my code with QSettings This works if I only restart my app but if I redistribute my app to Qt Creator or update it to Play Market Then Resetts QSettings in the initial state. I think removing the file associated with QSettings .

I am creating QSettings with the following code:

  QSettings Settings (QStringLiteral ("Company"), QStringLiteral ("App"), Nullptr);  

Thanks!

You can try to specify the location setting file in a writable location then Also exists, even if the application has been deleted:

  #include & lt; QSettings & gt; # Include & lt; QStandardPaths & gt; QString Path; QString file name; Path = QStandardPaths :: Written Place (QStandardPaths :: GenericDataLocation); File name = "config.ini"; Quitting Settings (Path + "/" + File Name, Quotes :: Informat);  

Here QStandardPaths :: GenericDataLocation gives a directory location where the shared data in the applications can be stored continuously and it is never empty.

In addition to this you can set the name of the application and organization in the main of your application:

  qApp-> Set organization name ("company"); QApp- & gt; SetApplicationName ("application");  

Comments

Popular posts from this blog

Member with no value in F# -

java - Joda Time Interval Not returning what I expect -

c# - Showing a SelectedItem's Property -