Let's define a in A.qml the following component:
Item {
function test() { console.log("this is a test") }
}
And in B.qml we do the following:
A {
function test2() { console.log("this is a second test") }
}
In C++ I create a QQuickView and set the source as B.qml. Now I try to invoke "test" and it fails with an error message that says that "test does not exist in B". If I invoke "test2" everything works as expected. If I change test2 for the following:
A {
function test2() { test() }
}
It succeeds in calling test().
The question is, how do I call the test() function directly from C++ when it is defined the A.qml component?
Note: I´m using Qt 5.7.1