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. QML with local database SQLite

QML with local database SQLite

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
5 Posts 3 Posters 1.5k 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.
  • C Offline
    C Offline
    Calvev
    wrote on last edited by
    #1

    Hi everyone,

    I'm really new with QT Quick and loving it. I'm planning to create an app that uses SQLite as local database.
    However, I'm not sure how to do it. I have no problem doing it on normal QT application but since I learned about QT Quick, I prefer it over the QT application.

    Could anyone point me to where I should be looking?

    Thank you,

    1 Reply Last reply
    0
    • jpnurmiJ Offline
      jpnurmiJ Offline
      jpnurmi
      wrote on last edited by
      #2

      Perhaps http://doc.qt.io/qt-5/qtquick-localstorage-qmlmodule.html is what you're looking for.

      1 Reply Last reply
      0
      • C Offline
        C Offline
        Calvev
        wrote on last edited by
        #3

        I found this to be perfect:

        https://wiki.qt.io/How_to_Use_a_QSqlQueryModel_in_QML

        Though I'm not quite sure what certain lines do. I'll have to learn it further. But,. it is now working perfectly.

        I can now read my DB. For writing into the DB, I have implemented another class of QObject and set it as property in my QML.

        1 Reply Last reply
        0
        • benlauB Offline
          benlauB Offline
          benlau
          Qt Champions 2016
          wrote on last edited by
          #4

          If you would like to try a ORM solution, you may take a look at :

          danielfranca/quickmodel: QuickModel: ORM for Qt/Quick

          1 Reply Last reply
          0
          • C Offline
            C Offline
            Calvev
            wrote on last edited by
            #5

            Thanks for the suggestion, I'll look into the ORM :)

            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