Please, is it possible to access and change a property of a qml element from javascript function? I read that document.getElementById() should do the trick, but when I try that I get:
ReferenceError: document is not defined
Test.qml
import QtQuick 2.0
import QtQuick.Controls 1.2
import Test.js as JS
Rectangle{
id: rect
color: "red"
onClicked: {
JS.changeMe();
}
}
Test.js
function changeMe(){
//change the color of element "rect"
//document.getElementById("rect")
}