So, should I send the value from qml to c++ to do a search there instead? It's the solution I ended up doing but I hoped storing something on JS side was possible to not cross language boundaries on each item initialization.

If you cannot port to Qt6 and compile the QML code to C++, this may be one of the rare cases where you might use a var property in QML. If you store the value of the property in a var, the list wrapper is stored, not only the list value. Whenever you access it from elsewhere, the engine will use the same list wrapper again.

In Qt6 you can use a list<string> instead of var for the same effect, but with type.

(At least this is how it should work. I don't think we have a test for this particular case. So, if it doesn't work, please file a bug)

best regards,
Ulf
_______________________________________________
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest

Reply via email to