Qt World Summit: Submit your Presentation

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


    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