Is there any way to check existence and access a dynamically created object in QML/javascript (without using C++)?
I’m trying to create an application with an interface similar to a map – given an key and a object, my application must locate if an object with the key exists and overwrite with the new object. If it doesn’t, the app must create a new object and associate with the key.
The documentation says that dynamically managed objects doesn’t have IDs, and the only way I found to access them was by using objectName, which seems to require C++ application.
thanks in advance.
You can use JavaScript object as a map. You can’t directly manipulate it in QML, but you can move all code to handle this object into JavaScript file and include it as a module.
Here is a simple example:
Map.js:
QML example:
The output will be: