Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Local storage. Approach [SOLVED]
Qt 6.11 is out! See what's new in the release blog

Local storage. Approach [SOLVED]

Scheduled Pinned Locked Moved Mobile and Embedded
4 Posts 2 Posters 1.6k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    Kofr
    wrote on last edited by Kofr
    #1

    Hi guys.
    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?

    p3c0P 1 Reply Last reply
    0
    • K Kofr

      Hi guys.
      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?

      p3c0P Offline
      p3c0P Offline
      p3c0
      Moderators
      wrote on last edited by
      #2

      @Kofr Since you are using C++ models

      Shall I use C++ for realizing Local Storage?

      Yes.

      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?

      Since you are using QML/Javascript only for view its better to do with C++ as the model can integrate with it easily.

      157

      1 Reply Last reply
      1
      • K Offline
        K Offline
        Kofr
        wrote on last edited by
        #3

        @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?

        p3c0P 1 Reply Last reply
        0
        • K Kofr

          @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?

          p3c0P Offline
          p3c0P Offline
          p3c0
          Moderators
          wrote on last edited by
          #4

          @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.

          157

          1 Reply Last reply
          1

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved