Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    When does the model resolve data?

    General and Desktop
    model view prog
    2
    2
    565
    Loading More Posts
    • 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
      Peppy last edited by Peppy

      Hello guys, I do wonder how the model (QAbstractItemModel) works, because it loads data after it's been set to the (any) view. How and when the model asks for data? Let's say, data are handled from the network, but, is there any kind of lazy loading behind the scenes?

      1 Reply Last reply Reply Quote 0
      • SGaist
        SGaist Lifetime Qt Champion last edited by

        Hi,

        It depends on your implementation. Generally speaking, you trigger the whatever is needed to grab the data over the network and once you have it you populate your model and if done correctly, this will trigger the machinery that will make all view aware that new data are available and they should update.

        Hope it helps

        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 Reply Quote 0
        • First post
          Last post