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

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 10 May 2015, 03:27 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 10 May 2015, 07:42 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 10 May 2015, 15:22
      0
      • M mcosta
        10 May 2015, 07:42

        Hi and welcome to devnet,

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

        F Offline
        F Offline
        fr0st-
        wrote on 10 May 2015, 15:22 last edited by fr0st- 5 Oct 2015, 15:52
        #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 10 May 2015, 16:42 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 10 May 2015, 16:51
          0
          • M mcosta
            10 May 2015, 16:42

            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 10 May 2015, 16:51 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 10 May 2015, 17:02 last edited by mcosta 5 Oct 2015, 17:05
              #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 10 May 2015, 18:35
              0
              • M mcosta
                10 May 2015, 17:02

                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 10 May 2015, 18:35 last edited by
                #7

                @mcosta I tried , but nothing ..

                1 Reply Last reply
                0

                1/7

                10 May 2015, 03:27

                • Login

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