P
P
Philip Bondarev2018-05-16 12:59:12
Qt
Philip Bondarev, 2018-05-16 12:59:12

How to store the state of QML controls when filtering a model?

Good afternoon. Guys, please tell me how I understood, if I use QSqlQueryModel in an application written in QML , then in order to store the states of checkboxes, fields and other parameters, it is necessary to define Q_PROPERTY in the model and add temporary state data to them, so you can not write to the base. And everything would be fine (I don’t know yet, I haven’t implemented it yet), but here the question arises. I have a large number of properties, and in order to find the right one, I filtered by adding to the query passed to the model's setQuery() - LIKE "%%1%" . In this case, it seems to me that the data on the state of the controls, written in Q_PROPERTYvanishes as soon as I apply the filter, am I right? And if so, how would you implement something like this?
There is an idea, to form a JS object and when you click on a checkbox, some in the list, write information there, and then pass the marked items to the model for writing to the database. But it's kind of a crutch.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question