Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Using SQLite in QML - How to persist data on application shutdown
Forum Updated to NodeBB v4.3 + New Features

Using SQLite in QML - How to persist data on application shutdown

Scheduled Pinned Locked Moved QML and Qt Quick
3 Posts 3 Posters 2.0k Views 1 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.
  • cmessineoC Offline
    cmessineoC Offline
    cmessineo
    wrote on last edited by
    #1

    Hi, I am able to create a sql lite database connection, create tables and add data to the tables via javascript. Problem is on application shutdown the data is not persisted to a file. Is it even possible to persist for future application starts and restarts, or is the sql data file deleted on application shut down?

    Thanks

    1 Reply Last reply
    0
    • C Offline
      C Offline
      chrisadams
      wrote on last edited by
      #2

      I'm not sure I understand.
      Are you using the QtQuick.LocalStorage import? Or are you writing your own adapter / C++ object which does the sqlite storage and exposes API to QML?

      If the former, and there is a specific bug with the way that persisted data is not available after application restart, then please file a bug with a minimal test case, in the Qt Project JIRA.

      If the latter, then most likely there's a bug in your adapter (eg, you might not be committing the changes that you've written or something, and so the updates are being lost when you close your application, because they haven't been persisted to disc).

      Cheers,
      Chris.

      1 Reply Last reply
      0
      • M Offline
        M Offline
        mivoligo
        wrote on last edited by
        #3

        Take a look at this: http://www.developer.nokia.com/Community/Wiki/How-to_create_a_persistent_settings_database_in_Qt_Quick_(QML) It might be what you're looking for.

        1 Reply Last reply
        0

        • Login

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