One Models for two View
-
Hello,
I would like to receive information via the serial link and update a QML interface.
I'd like to do this properly with a model-view-delegate architecture, but I don't know how to go about it because in my received data, there's a part I want to display in a ListView and a specific delegate, and a second part in another ListView and its specific delegate.I don't know how to do this properly.
- Should I import a C++ class into QML to manage my serial link with two models (feasible?)?
- Should I import a single large C++ model and filter it in my ListView?
- Any other way I don't know about?
Do you have an idea of a good way to do this? Thanks for your help.
-
Hi,
If you have all the information you need within on model, there's no reason to split it especially if you have a single input such as a serial port.
You should be able to configure your views to show exactly what you want from the model. Worst case, you can put proxy models between but it does not look like you would need that in your case.