Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. C++ + QML + SQLite + ListView. Exporting Data
Forum Update on Monday, May 27th 2025

C++ + QML + SQLite + ListView. Exporting Data

Scheduled Pinned Locked Moved General and Desktop
7 Posts 2 Posters 3.1k Views
  • 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.
  • F Offline
    F Offline
    fr0st-
    wrote on last edited by
    #1

    Hi, I'm trying to export data from SQLite to a ListView , the result is an empty ListView without errors in Qt Creator.
    C++ | QML | I'm following this example

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mcosta
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      I don't see where you set your database connection; read here

      Once your problem is solved don't forget to:

      • Mark the thread as SOLVED using the Topic Tool menu
      • Vote up the answer(s) that helped you to solve the issue

      You can embed images using (http://imgur.com/) or (http://postimage.org/)

      F 1 Reply Last reply
      0
      • M mcosta

        Hi and welcome to devnet,

        I don't see where you set your database connection; read here

        F Offline
        F Offline
        fr0st-
        wrote on last edited by fr0st-
        #3

        @mcosta My connection is made in the class constructor Database and working as it should, the problem is that the data from the database does not fill the ListView
        connection

        1 Reply Last reply
        0
        • M Offline
          M Offline
          mcosta
          wrote on last edited by
          #4

          Can you add some debug line in Database::getAll() in order to verify the data are loaded?

          BTW, if you read here you'll find a different approach to create a ObjectList model

          Once your problem is solved don't forget to:

          • Mark the thread as SOLVED using the Topic Tool menu
          • Vote up the answer(s) that helped you to solve the issue

          You can embed images using (http://imgur.com/) or (http://postimage.org/)

          F 1 Reply Last reply
          0
          • M mcosta

            Can you add some debug line in Database::getAll() in order to verify the data are loaded?

            BTW, if you read here you'll find a different approach to create a ObjectList model

            F Offline
            F Offline
            fr0st-
            wrote on last edited by
            #5

            @mcosta debug lines as u can see, loads 1380 items.

            1 Reply Last reply
            0
            • M Offline
              M Offline
              mcosta
              wrote on last edited by mcosta
              #6

              Hi,

              in the link I posted the delegate uses this syntax model.modelData.<field_name> to access model data

              Sorry, At the moment I can try the code.

              Once your problem is solved don't forget to:

              • Mark the thread as SOLVED using the Topic Tool menu
              • Vote up the answer(s) that helped you to solve the issue

              You can embed images using (http://imgur.com/) or (http://postimage.org/)

              F 1 Reply Last reply
              0
              • M mcosta

                Hi,

                in the link I posted the delegate uses this syntax model.modelData.<field_name> to access model data

                Sorry, At the moment I can try the code.

                F Offline
                F Offline
                fr0st-
                wrote on last edited by
                #7

                @mcosta I tried , but nothing ..

                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