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. Passing list of Structure to QML
Forum Updated to NodeBB v4.3 + New Features

Passing list of Structure to QML

Scheduled Pinned Locked Moved QML and Qt Quick
4 Posts 2 Posters 2.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.
  • P Offline
    P Offline
    psbhardwaj09gmail.com
    wrote on last edited by
    #1

    Hello Everyone,

    I am newbie in Qt Quick. I am making a project in which i need to get list of contacts as list of strutcs. Then i need to pass this list to QML. But i don't know how to do this. So please give me suggestion about this.
    Thanks in advance.

    Pardeep Sharma

    1 Reply Last reply
    0
    • D Offline
      D Offline
      daliusd
      wrote on last edited by
      #2

      It depends how deep you need to go into rabbit hole. At first it is unclear where from you need to pass list to QML. ListModel basically fits your needs: http://doc.qt.digia.com/qt/qml-listmodel.html

      If you need to pass list from C++ to QML when look here (it should give at least several different ideas where to start): http://qt-project.org/wiki/How_to_use_a_QSqlQueryModel_in_QML

      1 Reply Last reply
      0
      • P Offline
        P Offline
        psbhardwaj09gmail.com
        wrote on last edited by
        #3

        Thanks for Your reply.

        I want to pass list from C++. I don't want to access sql directly. Actually i want to use model & view concept.

        Pardeep Sharma

        1 Reply Last reply
        0
        • D Offline
          D Offline
          daliusd
          wrote on last edited by
          #4

          You should look links I gave more closely. Second one gives link to this blog article: http://cdumez.blogspot.com/2010/11/how-to-use-c-list-model-in-qml.html

          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