When does the model resolve data?



  • 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?


  • Lifetime Qt Champion

    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


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.