This is what I tried:
TestB.qml
import QtQuick 2.0
Rectangle
{
id: myItem
width: 100; height: 100
function f ()
{
console.log ("sadsad");
}
}
import QtQuick 2.0
Rectangle
{
id: myItem
width: 100; height: 100
function f ()
{
console.log ("sadsad");
}
}
To copy to clipboard, switch view to plain text mode
TestA.qml
import QtQuick 2.0
Item
{
width: 100; height: 100
Loader
{
id: myLoader
source: "TestB.qml"
}
MouseArea
{
anchors.fill: parent
onClicked:
{
console.log ("You clicked on tab!");
Connections
{
target: myLoader.f();
}
}
}
}
import QtQuick 2.0
Item
{
width: 100; height: 100
Loader
{
id: myLoader
source: "TestB.qml"
}
MouseArea
{
anchors.fill: parent
onClicked:
{
console.log ("You clicked on tab!");
Connections
{
target: myLoader.f();
}
}
}
}
To copy to clipboard, switch view to plain text mode
and the error I get is:
TestA.qml:15: TypeError: Object [object Object] has no method 'f'
TestA.qml:15: TypeError: Object [object Object] has no method 'f'
To copy to clipboard, switch view to plain text mode
Bookmarks