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. How to populate form asynchronously
Forum Updated to NodeBB v4.3 + New Features

How to populate form asynchronously

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
4 Posts 3 Posters 503 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.
  • ocgltdO Offline
    ocgltdO Offline
    ocgltd
    wrote on last edited by
    #1

    I have succesfully built an QAbstractItemModel which populates my view asynchronously. Each cell of the view holds a SUMMARY of an ITEM (row) in my database.

    I know which to edit the ITEM, and need to retrieve ALL fields from the row, and populate a larger form. My model above is of summary data only.

    What is the right way to populate the form asynchronously? Do I have to make another model with ALL fields? (That feels wrong somehow).

    eyllanescE 1 Reply Last reply
    0
    • ocgltdO ocgltd

      I have succesfully built an QAbstractItemModel which populates my view asynchronously. Each cell of the view holds a SUMMARY of an ITEM (row) in my database.

      I know which to edit the ITEM, and need to retrieve ALL fields from the row, and populate a larger form. My model above is of summary data only.

      What is the right way to populate the form asynchronously? Do I have to make another model with ALL fields? (That feels wrong somehow).

      eyllanescE Offline
      eyllanescE Offline
      eyllanesc
      wrote on last edited by
      #2

      @ocgltd Your question is unclear, could you provide a minimal and verifiable example

      If you want me to help you develop some work then you can write to my email: e.yllanescucho@gmal.com.

      ocgltdO 1 Reply Last reply
      0
      • eyllanescE eyllanesc

        @ocgltd Your question is unclear, could you provide a minimal and verifiable example

        ocgltdO Offline
        ocgltdO Offline
        ocgltd
        wrote on last edited by
        #3

        @eyllanesc I don't have an example because I'm still at the design stage. But I'll try to rephrase.

        My QAbstractItemModel works great when populating a view with many items. Now, I need to populate a single form, with the data from a single row of my database, for editting.

        The QAbstractItemModel seems like overkill for this. I just need to retrieve the data and fill in the form. But this must be asynchronous because the source of the data is across the internet.

        What mechanism should I use to fetch the data and populate the form when ready. The QAbstractItemModel seems too complex (though I imagine it would work). I'm not sure what else is available for this type of scenario.

        jeremy_kJ 1 Reply Last reply
        0
        • ocgltdO ocgltd

          @eyllanesc I don't have an example because I'm still at the design stage. But I'll try to rephrase.

          My QAbstractItemModel works great when populating a view with many items. Now, I need to populate a single form, with the data from a single row of my database, for editting.

          The QAbstractItemModel seems like overkill for this. I just need to retrieve the data and fill in the form. But this must be asynchronous because the source of the data is across the internet.

          What mechanism should I use to fetch the data and populate the form when ready. The QAbstractItemModel seems too complex (though I imagine it would work). I'm not sure what else is available for this type of scenario.

          jeremy_kJ Offline
          jeremy_kJ Offline
          jeremy_k
          wrote on last edited by
          #4

          @ocgltd said in How to populate form asynchronously:

          @eyllanesc I don't have an example because I'm still at the design stage. But I'll try to rephrase.

          My QAbstractItemModel works great when populating a view with many items. Now, I need to populate a single form, with the data from a single row of my database, for editting.

          The QAbstractItemModel seems like overkill for this. I just need to retrieve the data and fill in the form. But this must be asynchronous because the source of the data is across the internet.

          It sounds like the program has already retrieved the data, converted it into a model, and used a view to select an element from the model. Why not use the same model again? The view used to select the data of interest should provide a current or selected QModelIndex. The secondary view can either be another QAbstractItemView which displays the same index, or directly use QAbstractItemModel::data().

          Asking a question about code? http://eel.is/iso-c++/testcase/

          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