I'm having an issue with QML/JS integration.
I have a javascript list variable stored in a .js file. I want to write to this variable from one QML file, and read it from another QML file. I cannot seem to find a solution to this. I've over-simplified my actual code to make it comprehensible!
// writeValue.QML
import "../javascript/storedValue.js" as StoredValue
...
MouseArea{
onClicked{
StoredValue.value.push(1)
}
}
// readValue.QML
import "../javascript/storedValue.js" as StoredValue
...
Text{
text : StoredValue.value
}
//storedValue.js
var value = []
I have tried using '.pragma library' and not using it, to no avail.
What happens is the writeValue.QML writes successfully, so [1, 1, ,1, ...]. Whereas readValue.QML just finds an empty list, [].