I have an issue with that my WorkerScript does not reach updated data in a ListModel.
The code above updates the title property on the first element in the model by adding a "!" to the title.Code:ListModel { id: listModel ListElement{title:"test"} } Timer { repeat: true; interval: 2000; running: true onTriggered: { listModel.setProperty(0, "title", listModel.get(0).title+"!") console.log("Title outside: "+listModel.get(0).title) worker.sendMessage({'model': listModel}); } } WorkerScript { id: worker source: "worker.js" }
By worker.js contains:
but if run this code the console shows:Code:.pragma library WorkerScript.onMessage = function(msg) { console.log("Title in script: "+msg.model.get(0).title) }
It looks like the updated model is not reached by the script. What is the correct way to do this?Code:Title outside: test! Title in script: test! Title outside: test!! Title in script: test! Title outside: test!!! Title in script: test! Title outside: test!!!! Title in script: test!



