Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Local storage. Approach [SOLVED]
Kofr last edited by Kofr
I am writing a crossplatform QtQuick application which has QML Front-end (view) and C++ back-end (model).
I am picking up an approach to store local user data crossplatform way. So far I found that there is example of implementing Local Storage with QML.
However my QML (MVC template) is considered only as View functionality, moreover, all data models are implemented with C++.
Shall I use C++ for realizing Local Storage? If yes, where to get example to make it crossplatform. Or It is fine practice to use QML?
@Kofr Since you are using C++ models
Shall I use C++ for realizing Local Storage?
If yes, where to get example to make it crossplatform.
Since Qt has inbuilt support for SQLite it will automatically be crossplatform. You can follow this example and specifically follow Connecting to a Database topic.
Or It is fine practice to use QML?
Kofr last edited by
@p3c0 thx, I mean crossplatform in the way that all data will be stored on Android, iOs, Windows natively where userdata must be located. Will it be located natively?
For example, after deinstalling app in Android, will it leave mess of user data in system?
@Kofr Leave it to Qt to figure out the paths i.e use QStandardPaths. See QStandardPaths::writableLocation and QStandardPaths::standardLocations. Preferably use QStandardPaths::AppDataLocation as
StandardLocation. I think in android after the user uninstalls the app his data too erases.