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. QT Quick Sqlite Example
Forum Updated to NodeBB v4.3 + New Features

QT Quick Sqlite Example

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
4 Posts 4 Posters 1.6k Views 3 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.
  • T Offline
    T Offline
    TigerBunny
    wrote on last edited by
    #1

    I found this:

    https://wiki.qt.io/How_to_Use_a_QSqlQueryModel_in_QML

    But the "Step 5: Allow QML to see the model:" section is incomplete and does not explain where to put the code.

    Is there a full example of using QT Quick with Sqlite suitable for a beginner. If not suitable for beginner, then one where I can figure out what I need to know to make it work?

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

      Oh man, I empathize with you.

      The problem you're having is you don't know how QML and C++ are integrated. First read these docs: https://doc.qt.io/qt-5/qtqml-cppintegration-topic.html

      Then make your own "hello world" extension that you plug in.

      After that, it should be clear where to attach that model. Then I hope you will update the wiki with your full example :)

      1 Reply Last reply
      0
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #3

        That part of the code should be in your main function.

        Looks this article is a bit outdated.

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply
        0
        • T TigerBunny

          I found this:

          https://wiki.qt.io/How_to_Use_a_QSqlQueryModel_in_QML

          But the "Step 5: Allow QML to see the model:" section is incomplete and does not explain where to put the code.

          Is there a full example of using QT Quick with Sqlite suitable for a beginner. If not suitable for beginner, then one where I can figure out what I need to know to make it work?

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

          Hi @TigerBunny,
          There's also this way.

          157

          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