V
V
Vitaly Petrov2015-11-13 20:53:39
Qt
Vitaly Petrov, 2015-11-13 20:53:39

Qt. Synchronizing the state of models on the client. How?

Hello. I will explain the question with an example.
There is one model class, let's say NewsListModel.
In a mobile or desktop application, two objects of this model are created - one instance for requesting a list of all news from the backend, the second one for requesting articles in the user profile, that is, belonging to the current authorized user.
All this is displayed accordingly on two different screens, the views do not intersect with each other in any way, and the models themselves, too. Although the models refer to the same data source.
Each news, for example, you can like.
Our current user, being in his profile, likes some news, of course, information about this is recorded in the model and, for example, is synchronized with the server.
The problem is that when the user goes to the page for viewing all news, where the second object of the same model class is used, the information in this window will be outdated for the user. That is, the corresponding news in the list will not be liked.
I have a couple of thoughts on how you can try to solve this problem, but I would like to first know if there is already a ready-made solution? Maybe not from the Qt area, the problem is of a general nature ...

Answer the question

In order to leave comments, you need to log in

1 answer(s)
J
Jacob E, 2015-11-13
@Zifix

And if so - there is only one model, we directly use it to request all news from the backend, and issue a list of articles in the profile through filtering the same model using QAbstractProxyModel?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question