I want to call a method in qml - javascript from c++. Basically I think that I have done everything that is said in documentation. I can call the method if it is like this:
Rectangle {
......
Component.onCompleted:{
...........
}
function foo(arg1, arg2)
{
................
}
}
But I can't call the same function if I put it like this and in a separate .js file it like this:
import ../Script.js as Script
Rectangle {
.........
Component.onCompleted:{
Script.foo(arg1,arg2)
}
}
The script is imported and everything, but I still have a problem that says that the arguments are not recognized. Any help will be appreciated. Thanks